ngrx-actions icon indicating copy to clipboard operation
ngrx-actions copied to clipboard

@Effect() decorator does not work

Open mattbgold opened this issue 6 years ago • 1 comments

@Effect(MyAction) decorator is not working, effect functions are never called. Using @ngrx/effects @Effect() works as expected.

Versions: "@angular/core": "~7.0.0", "@ngrx/store": "^6.1.2", "@ngrx/effects": "^6.1.2", "ngrx-actions": "^4.0.0",

Example code

@Store(initialAppState)
export class AppStore {
    @Action(TestAction)
    test(state: AppState, action: TestAction) {
        state.test = 1;
        // this runs after dispatch
    }

    @Action(TestComplete)
    complete(state: AppState) {
        state.test = 2;
        // never runs
    }

    @Effect(TestAction)
    testEffect() {
         //never runs
        return of(new TestComplete());
    }
 }

I have tried this with every combination of EffectsModule.forRoot() i could think of, passing empty array, array containing the store class, no EffectsModule import, etc..

mattbgold avatar Nov 13 '18 23:11 mattbgold

Same issue here. @ngrx/effects module v.6.1.2 does not support.

EffectsModule.run(myEffects)
EffectsModule.runAfterBootstrap(trackingMyEffects)

Please provide any information on how to fix this issue on Angular 6.1.2. Thanks

jodavaga avatar Jul 25 '19 15:07 jodavaga