Skip to content

Commit

Permalink
fix(store): ensure features are initialized later
Browse files Browse the repository at this point in the history
We have a check that ensures states are initialized in the correct order and
that the `UpdateState` action shouldn't be dispatched before the `InitState` action.
This code updates the order of environment providers to place features at the end.
As a result, the root environment initializer runs earlier, dispatching the `InitState` action.
  • Loading branch information
arturovt committed Nov 28, 2023
1 parent 7398dd9 commit 31acbfd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/store/src/standalone-features/provide-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ export function provideStore(

return makeEnvironmentProviders([
...getRootProviders(states, options),
features,
NGXS_ROOT_ENVIRONMENT_INITIALIZER
NGXS_ROOT_ENVIRONMENT_INITIALIZER,
features
]);
}

Expand Down

0 comments on commit 31acbfd

Please sign in to comment.