diff --git a/modules/store/src/selector.ts b/modules/store/src/selector.ts index e2f1a129cc..df6b872cd3 100644 --- a/modules/store/src/selector.ts +++ b/modules/store/src/selector.ts @@ -470,6 +470,27 @@ export function createSelector< ) => Result ): MemoizedSelectorWithProps; +/** + * @deprecated + * Selectors with only a projector function aren't valid anymore and will be removed in version 8.0.0 + * + * BEFORE: + * + * ```ts + * const getTodosById = createSelector( + * (state: TodoAppSchema, id: number) => state.todos.find(p => p.id === id) + * ); + * ``` + * + * AFTER: + * + * ```ts + * const getTodosById = createSelector( + * (state: TodoAppSchema) => state.todos, + * (todos: Todo[], id: number) => todos.find(p => p.id === id) + * ); + * ``` + */ export function createSelector( projector: SelectorWithProps ): MemoizedSelectorWithProps;