From 41259149e9322fcf54cd8e1e4e7e5b3991a3b221 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Barri=C3=A8re?= Date: Sat, 18 Nov 2017 02:51:39 +0100 Subject: [PATCH] fix(RouterStore): Fix usage of config object if provided (#575) --- modules/router-store/src/router_store_module.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/router-store/src/router_store_module.ts b/modules/router-store/src/router_store_module.ts index e77ec9b567..0e76b3604a 100644 --- a/modules/router-store/src/router_store_module.ts +++ b/modules/router-store/src/router_store_module.ts @@ -124,11 +124,15 @@ export const ROUTER_CONFIG = new InjectionToken( ); export const DEFAULT_ROUTER_FEATURENAME = 'routerReducer'; -export function _createDefaultRouterConfig(config: any): StoreRouterConfig { - let _config = {}; +export function _createDefaultRouterConfig( + config: StoreRouterConfig | StoreRouterConfigFunction +): StoreRouterConfig { + let _config: StoreRouterConfig; if (typeof config === 'function') { _config = config(); + } else { + _config = config || {}; } return {