Skip to content

Effects execution order not guaranteed #64

@jmeinlschmidt

Description

@jmeinlschmidt

Which @ngneat/effects-* package(s) are the source of the bug?

effects, effects-ng

Is this a regression?

No

Description

Please see the complete example at Stackblitz.

Although the effects execution order should be intuitively dependent on the execution order of actions, in reality, it depends on the effects declaration order.

The example provided in the Stackblitz prints SECOND followed by FIRST, even though it should be the other way. In order to fix this behaviour, it is necessary to change the effects declaration order (moving the load effect at the end). This can introduce some serious bugs which are hard to explore.

Please provide a link to a minimal reproduction of the bug

https://stackblitz.com/edit/stackblitz-starters-heh5qh?devToolsHeight=33&file=src%2Ftodo.effects.ts

Please provide the exception or error you saw

No response

Please provide the environment you discovered this bug in

No response

Anything else?

In my opinion, this should be mentioned in the docs, at least.

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