Skip to content
This repository was archived by the owner on Jul 8, 2021. It is now read-only.

@Effect() decorator does not work #61

Open
mattbgold opened this issue Nov 13, 2018 · 1 comment
Open

@Effect() decorator does not work #61

mattbgold opened this issue Nov 13, 2018 · 1 comment

Comments

@mattbgold
Copy link

@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..

@jodavaga
Copy link

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants