Skip to content

Commit

Permalink
fix(RouterStore): Fix usage of config object if provided (#575)
Browse files Browse the repository at this point in the history
  • Loading branch information
fredgate authored and brandonroberts committed Nov 18, 2017
1 parent d26cfe8 commit 4125914
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions modules/router-store/src/router_store_module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 4125914

Please sign in to comment.