From 2bea205c3d04eb57c5ee6ca7424f818cca157a2f Mon Sep 17 00:00:00 2001 From: Tim Deschryver <28659384+timdeschryver@users.noreply.github.com> Date: Fri, 12 Feb 2021 22:45:24 +0100 Subject: [PATCH] fix(store): forFeature using instanceof instead of typeof (#2922) Closes #2919 --- modules/store/src/store_module.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/modules/store/src/store_module.ts b/modules/store/src/store_module.ts index 62ea61c636..b58ac1121e 100644 --- a/modules/store/src/store_module.ts +++ b/modules/store/src/store_module.ts @@ -221,16 +221,16 @@ export class StoreModule { { provide: _FEATURE_CONFIGS, multi: true, - useValue: typeof featureNameOrSlice === 'string' ? config : {}, + useValue: featureNameOrSlice instanceof Object ? {} : config, }, { provide: STORE_FEATURES, multi: true, useValue: { key: - typeof featureNameOrSlice === 'string' - ? featureNameOrSlice - : featureNameOrSlice.name, + featureNameOrSlice instanceof Object + ? featureNameOrSlice.name + : featureNameOrSlice, reducerFactory: !(config instanceof InjectionToken) && config.reducerFactory ? config.reducerFactory @@ -254,9 +254,9 @@ export class StoreModule { provide: _FEATURE_REDUCERS, multi: true, useValue: - typeof featureNameOrSlice === 'string' - ? reducersOrConfig - : featureNameOrSlice.reducer, + featureNameOrSlice instanceof Object + ? featureNameOrSlice.reducer + : reducersOrConfig, }, { provide: _FEATURE_REDUCERS_TOKEN,