"it would be nice if we could inject our debugging/logging services...."
It would be nice indeed. This doesn't work for me. Cannot access props. Also cannot inject Logging service as a constant... : (
So basically I have to now move all of this to WithEffects
export function withUserProfileReducers<_>() {
return signalStoreFeature(
{
state: type<UserProfileState>(),
props: type<{
_logger: LoggingService,
_storeName: string,
}>(),
},
withReducer(
on(
authEvents.logoutSuccess,
() => (state) : UserProfileState => {
const logger = inject(LoggingService)
const storeName = 'UserProfileStore';
store._logger.info('Clearing user profile state on logoutSuccess.', storeName);
return{
userProfileBasic: null,
userProfileFull: null,
status: UserProfileOperationStatusEnum.IDLE,
error: null
}
}
),