diff --git a/libs/mini-rx-store/src/lib/selector.ts b/libs/mini-rx-store/src/lib/selector.ts index bf6d299a..a27c422f 100644 --- a/libs/mini-rx-store/src/lib/selector.ts +++ b/libs/mini-rx-store/src/lib/selector.ts @@ -118,12 +118,9 @@ export function createSelector(...args: any[]): Selector { }); } -/** @deprecated Use `createFeatureStateSelector` which is more in line with `createComponentStateSelector` */ -export function createFeatureSelector(featureKey?: string): Selector; -/** @deprecated Use `createFeatureStateSelector` which is more in line with `createComponentStateSelector` */ -export function createFeatureSelector(featureKey: keyof T): Selector; -/** @deprecated Use `createFeatureStateSelector` which is more in line with `createComponentStateSelector` */ -export function createFeatureSelector(featureKey?: any): Selector { +export function createFeatureStateSelector(featureKey?: string): Selector; +export function createFeatureStateSelector(featureKey: keyof T): Selector; +export function createFeatureStateSelector(featureKey?: any): Selector { if (featureKey) { return createSelector( (state: any) => state[featureKey], @@ -133,7 +130,15 @@ export function createFeatureSelector(featureKey?: any): Selector { return (state) => state; // Do not memoize: when used with FeatureStore there is a new state object created for every `setState` } -export const createFeatureStateSelector = createFeatureSelector; +/** @deprecated Use `createFeatureStateSelector` which is more in line with `createComponentStateSelector` */ +export function createFeatureSelector(featureKey?: string): Selector; +/** @deprecated Use `createFeatureStateSelector` which is more in line with `createComponentStateSelector` */ +export function createFeatureSelector(featureKey: keyof T): Selector; +/** @deprecated Use `createFeatureStateSelector` which is more in line with `createComponentStateSelector` */ +export function createFeatureSelector(featureKey?: any): Selector { + return createFeatureStateSelector(featureKey); +} + export function createComponentStateSelector(): Selector { return (state: T) => state; }