Let's say we an action SyncUserData
, which returns observable that listen to changes from the database. Whenever there's a change, the action dispatches the action new PatchUserData(newData)
.
The SyncUserData
action is dispatched (only once) from ngxsOnInit
of the state.
In a different section (e.g., component), I want to do something whenever the action PatchUserData
is dispatching. Something like this:
this.store.onDispatch(PatchUserData).subscribe();
I was looking a bit in the source, and I didn't find something similar to my example.