From 025c1a491d2c3fc94ae4b0468cc85eb023b4e568 Mon Sep 17 00:00:00 2001 From: Arya Emami Date: Thu, 4 Jan 2024 19:21:55 -0600 Subject: [PATCH] Remove `TypedStructuredSelectorCreator` from docs --- website/docs/api/createStructuredSelector.mdx | 59 ------------------- website/docs/introduction/v5-summary.mdx | 1 - website/src/components/InternalLinks.tsx | 8 --- 3 files changed, 68 deletions(-) diff --git a/website/docs/api/createStructuredSelector.mdx b/website/docs/api/createStructuredSelector.mdx index 042b876a..bf0faea8 100644 --- a/website/docs/api/createStructuredSelector.mdx +++ b/website/docs/api/createStructuredSelector.mdx @@ -244,65 +244,6 @@ const nestedSelector = createStructuredSelector({ }) ``` -## `TypedStructuredSelectorCreator` (since 5.0.0) - -A helper type that allows you to create a pre-typed version of tailored to the provided root state type. - -{/* START: createStructuredSelector/createStructuredAppSelector.ts */} - - - - -```ts title="createStructuredSelector/createStructuredAppSelector.ts" -import type { TypedStructuredSelectorCreator } from 'reselect' -import { createStructuredSelector } from 'reselect' - -interface RootState { - todos: { - id: number - completed: boolean - title: string - description: string - }[] - alerts: { id: number; read: boolean }[] -} - -export const createStructuredAppSelector: TypedStructuredSelectorCreator = - createStructuredSelector - -const structuredSelector = createStructuredAppSelector({ - // The `state` argument is correctly typed as `RootState` - todos: state => state.todos, - alerts: state => state.alerts -}) -``` - - - - -```js title="createStructuredSelector/createStructuredAppSelector.js" -import { createStructuredSelector } from 'reselect' - -export const createStructuredAppSelector = createStructuredSelector - -const structuredSelector = createStructuredAppSelector({ - // The `state` argument is correctly typed as `RootState` - todos: state => state.todos, - alerts: state => state.alerts -}) -``` - - - - -{/* END: createStructuredSelector/createStructuredAppSelector.ts */} - ## Defining a Pre-Typed `createStructuredSelector` As of Reselect 5.0.2, you can create a "pre-typed" version of where the `state` type is predefined. This allows you to set the `state` type once, eliminating the need to specify it with every call. diff --git a/website/docs/introduction/v5-summary.mdx b/website/docs/introduction/v5-summary.mdx index 28bbf7c3..9651885f 100644 --- a/website/docs/introduction/v5-summary.mdx +++ b/website/docs/introduction/v5-summary.mdx @@ -31,7 +31,6 @@ Version 5.0.0 introduces several new features and improvements: ## Selector API Enhancements - Removed the second overload of due to its susceptibility to runtime errors. -- Added the utility type to facilitate the creation of a pre-typed version of for your root state. ## Additional Functionalities diff --git a/website/src/components/InternalLinks.tsx b/website/src/components/InternalLinks.tsx index 462778df..4c30b242 100644 --- a/website/src/components/InternalLinks.tsx +++ b/website/src/components/InternalLinks.tsx @@ -89,13 +89,5 @@ export const InternalLinks = { createStructuredSelector - )), - TypedStructuredSelectorCreator: memo(() => ( - - TypedStructuredSelectorCreator - )) } as const satisfies Record>