Creates a selector to derive state from multiple atoms.
The array of input atoms.
The return type of the selector.
The input atoms.
The function to compute the derived state.
A selector definition object.
Selectors allow you to compute derived state that updates whenever any of the input atoms change.
const sumSelector = selector([atomA, atomB], (a, b) => a + b); Copy
const sumSelector = selector([atomA, atomB], (a, b) => a + b);
Creates a selector to derive state from multiple atoms.