effects
effects copied to clipboard
Parameters not assignable to parameter of type
Which @ngneat/effects-* package(s) are the source of the bug?
effects
Is this a regression?
No
Description
I'm trying to put ngneat/effects on my ionic project but I get an error I don't understand, when I put the 'ofType' operator to observe my action it triggers this error:
Argument of type '(source: Observable<Action<string>>) => Observable<{ type: "[Spending] Load Spendings"; }>' is not assignable to parameter of type 'OperatorFunction<Action, { type: "[Spending] Load Spendings"; }>'.
it tells me it's a ts error, so I try to change the node version but nothing I still get the same error.
My action:
import { actionsFactory } from "@ngneat/effects";
const spendingActions = actionsFactory('Spending');
const loadSpending = spendingActions.create('[Spending] Load Spendings');
export { loadSpending };
my effect:
loadingSpendings$ = createEffect((actions) =>
actions.pipe(
ofType(spendingActions.loadSpending), // error triggered here
mergeMap(() =>
this.spendingService.loadSpending()
),
tap(setSpendings),
)
)
Please provide a link to a minimal reproduction of the bug
No response
Please provide the exception or error you saw
No response
Please provide the environment you discovered this bug in
Node version: 18.10
Ts version: 4.8.4
Anything else?
No response
Do you want to create a pull request?
No
Please reproduce it on stackblitz
This happened to me, too.
I believe it's because the ts-action-operators (which exports the ofType operator) is requiring the local rxjs lib, I can see the below structure in the node_modules directory:

with a global dep of rxjs in the project, there're always such different references to the same type.