Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions docs/usage/deriving-data-selectors.md
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ const brokenSelector = createSelector(
Similarly, a memoized selector should _never_ use `state => state` as an input! That will force the selector to always recalculate.
:::

In typical Reselect usage, you write your top-level "input selectors" as plain functions, and use `createSelector` to create memoized selectors that look up nested values:
In typical Reselect usage, you write your top-level "input selectors" as plain functions, and use `createSelector` to create memoized selectors that calculate derived values:

```js
const state = {
Expand All @@ -238,11 +238,9 @@ const state = {
b: 10
}

const selectA = state => state.a
const selectA1 = state => state.a.first
const selectB = state => state.b

const selectA1 = createSelector([selectA], a => a.first)

const selectResult = createSelector([selectA1, selectB], (a1, b) => {
console.log('Output selector running')
return a1 + b
Expand Down