diff --git a/modules/entity/src/create_adapter.ts b/modules/entity/src/create_adapter.ts index 0526ccf692..c51f85295f 100644 --- a/modules/entity/src/create_adapter.ts +++ b/modules/entity/src/create_adapter.ts @@ -10,12 +10,15 @@ import { createSelectorsFactory } from './state_selectors'; import { createSortedStateAdapter } from './sorted_state_adapter'; import { createUnsortedStateAdapter } from './unsorted_state_adapter'; -export function createEntityAdapter(options: { - selectId: IdSelector; - sortComparer?: false | Comparer; -}): EntityAdapter { +export function createEntityAdapter( + options: { + selectId?: IdSelector; + sortComparer?: false | Comparer; + } = {} +): EntityAdapter { const { selectId, sortComparer }: EntityDefinition = { sortComparer: false, + selectId: (instance: any) => instance.id, ...options, }; diff --git a/modules/store/src/store_module.ts b/modules/store/src/store_module.ts index c6f3abbc95..804c70c6bb 100644 --- a/modules/store/src/store_module.ts +++ b/modules/store/src/store_module.ts @@ -149,12 +149,16 @@ export class StoreModule { ): ModuleWithProviders; static forFeature( featureName: string, - reducer: ActionReducer| InjectionToken>, + reducer: ActionReducer | InjectionToken>, config?: StoreConfig ): ModuleWithProviders; static forFeature( featureName: string, - reducers: ActionReducerMap | InjectionToken> | ActionReducer | InjectionToken>, + reducers: + | ActionReducerMap + | InjectionToken> + | ActionReducer + | InjectionToken>, config: StoreConfig = {} ): ModuleWithProviders { return {