How can I trigger an action before or at the beginning of an effect in my code?
For instance:
saveSomething$ = createEffect(() =>
this.actions$.pipe(
ofType(SaveProjectAction),
tap(() => ImSavingNowAction()), // Triggering action here
withLatestFrom(this.store.select(selectSomething)),
mergeMap(([action, project]) => {
let save$ = this.api.call(something); // Performing a task that takes time
return save$.pipe(
map(
(project) => SavedSomethingAction({ something }),// Next Action to be invoked
catchError(() => EMPTY)
)
);
})
)
);