79657826

Date: 2025-06-08 12:22:57
Score: 1.5
Natty:
Report link

"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
          }
        }
      ),
Reasons:
  • RegEx Blacklisted phrase (2): doesn't work for me
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Sachin