File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -472,6 +472,27 @@ export function createSelector<
472472 ) => Result
473473) : MemoizedSelectorWithProps < State , Props , Result > ;
474474
475+ /**
476+ * @deprecated
477+ * Selectors with only a projector function aren't valid anymore and will be removed in version 8.0.0
478+ *
479+ * BEFORE:
480+ *
481+ * ```ts
482+ * const getTodosById = createSelector(
483+ * (state: TodoAppSchema, id: number) => state.todos.find(p => p.id === id)
484+ * );
485+ * ```
486+ *
487+ * AFTER:
488+ *
489+ * ```ts
490+ * const getTodosById = createSelector(
491+ * (state: TodoAppSchema) => state.todos,
492+ * (todos: Todo[], id: number) => todos.find(p => p.id === id)
493+ * );
494+ * ```
495+ */
475496export function createSelector < State , Props , Result > (
476497 projector : SelectorWithProps < State , Props , Result >
477498) : MemoizedSelectorWithProps < State , Props , Result > ;
You can’t perform that action at this time.
0 commit comments