Skip to content

Commit c409252

Browse files
brandonrobertsMikeRyanDev
authored andcommitted
fix(Store): Use existing reducers when providing reducers without an InjectionToken (#254)
Closes #250, related to #116
1 parent 0fc1bcc commit c409252

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

modules/store/src/store_module.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,11 @@ export class StoreModule {
107107
deps: [_INITIAL_STATE],
108108
},
109109
{ provide: _INITIAL_REDUCERS, useValue: reducers },
110-
reducers instanceof InjectionToken
111-
? [{ provide: _STORE_REDUCERS, useExisting: reducers }]
112-
: [],
110+
{
111+
provide: _STORE_REDUCERS,
112+
useExisting:
113+
reducers instanceof InjectionToken ? reducers : _INITIAL_REDUCERS,
114+
},
113115
{
114116
provide: INITIAL_REDUCERS,
115117
deps: [

0 commit comments

Comments
 (0)