Is it possible to use non-class-based actions with Nx Data Persistence? I could not find anything in the docs. This here is what I tried so far:
run: (action, state) => {
const booking: Booking = action.booking;
return this.httpClient.post<FirebasePostResponse>('https://foo/bar.json', booking).pipe(
map((res, err) => {
return bookingsAddOneSuccess({booking});
})
);
},
which is giving me a type mismatch error. I guess a workaround would be to use @Effect({dispatch: false})
and dispatch from the run method yourself without returning anything. But perhaps there is a better way, without misusing Effects?