This will not be the final answer, but hopefully it will be helpful.
Before you begin:
- Make sure you are using the latest versions of
@ngrx packages (which are appropriate for your version of Angular). - If you have updated any packages, make sure that you restart the development environment (that is, reboot the node, server, etc.).
If you haven’t done this yet, you should take a look at the implementation of the Store — so that you make some educated guesses about what might go wrong. Note that the Store pretty bright. This is both an observable (using the state as its source) and an observer (which reports to the dispatcher).
If you look at store.dispatch , you will see that it is an alias for store.next that calls next on Dispatcher .
Therefore, the call:
this.store.dispatch(new StandardSigninAction(this.formStatus.form.value.credentials));
you just need to see the action emitted by the dispatcher.
The observed Actions , which is introduced into your effects, are also quite easy. This is just an observable that uses Dispatcher as its source.
To look at the actions flowing through the effect, you can replace this:
@Effect() standardSignin$: Observable<Action> = this.actions$ .ofType(session.ActionTypes.STANDARD_SIGNIN)
with this:
@Effect() standardSignin$: Observable<Action> = this.actions$ .do((action) => console.log(`Received ${action.type}`)) .filter((action) => action.type === session.ActionTypes.STANDARD_SIGNIN)
ofType not an operator; this is a method, so to add a do log, you need to replace it with filter .
When you log into the system, if you get an action, something is wrong with the effect (or maybe the lines / constants of the types of actions are not what you think, but something is incompatible).
If the effect does not receive the dispatched action, the most likely explanation would be that the Store through which you send the StandardSigninAction is not the same Store that uses your effect - that is, you have a problem with the DI.
If so, you should look at what is different from the other SessionEffects , which, as you say, works. (At least you have something working, which is a good place to start experiments.) Are they sent from another module? The module that sends the StandardSigninAction function module?
What happens if you hack one of the SessionEffects workers to replace its submitted action with StandardSigninAction ? Is the effect performed?
Please note that the questions at the end of this answer are not questions I want to answer; these are questions that you should ask yourself and research.