id
is the identity function.
const id = state => state;
It can be used with pick
to create selectors by-id.
const getPostById = pick`posts.byId.${id}`;
Instead of:
const getPostById = pick`posts.byId.${x => x}`;
Or a no-no:
const getPostById = postId => pick`posts.byId.${postId}`;
P.S. The last example is "bad" because it will compile a new selector
on every getPostById
invocation, whereas the two above will compile
only once.