Skip to content

Parameters not assignable to parameter of type #37

@tibdev78

Description

@tibdev78

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions