i try to understand how typeof effects work under the hood in ngrx, if i declare in my app module:
....
@NgModule({
imports: [
EffectsModule.forRoot([TodosEffectsService])
],
....
and i write effect file sure:
@Effect() createTodos$ = this.actions$
.ofType(CREATE_TASK)
.map(() => {
console.log('called');
return { type: 'OTHER'};
});
@Effect() addTodos$ = this.actions$
.ofType(CREATE_TASK)
.map(() => {
console.log('called');
return { type: 'OTHER'};
});
i try to understand, now in run time i dispatch a action this.action$ is subscribed and every time execute ofType to match the type? or ofType once execute!?
if it called once, when i dispatch action how effects know every time witch effect to subscribe/execute?
thank all!