Angular - State Management
Identify the error in this effect code:
saveData$ = createEffect(() => this.actions$.pipe(
ofType(saveData),
switchMap(action => this.api.save(action.payload)),
map(() => saveDataSuccess()),
catchError(error => saveDataFailure({ error }))
));