paint-brush
Calculating Derived State in JavaScript Using Selectorsby@nas5w
1,004 reads
1,004 reads

Calculating Derived State in JavaScript Using Selectors

by Nick Scialli3mJune 1st, 2019
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

Selectors are functions that take state as a property and return the derived state value. This is because it’s inefficient to recalculate a selector if its input hasn’t fundamentally changed. Selectors can use higher order functions to compose selectors from other selectors. The result of a higher order function is based on the result of the function passed to create a new selector. The new selector will map over all the input functions to determine their results based on their results. The selector library includes additional functionality to memoize selector results.

Companies Mentioned

Mention Thumbnail
Mention Thumbnail
featured image - Calculating Derived State in JavaScript Using Selectors
Nick Scialli HackerNoon profile picture
Nick Scialli

Nick Scialli

@nas5w

Husband, dog dad, coffee monster. Software engineer at the @usds! Opinions are my own

About @nas5w
LEARN MORE ABOUT @NAS5W'S
EXPERTISE AND PLACE ON THE INTERNET.
L O A D I N G
. . . comments & more!

About Author

Nick Scialli HackerNoon profile picture
Nick Scialli@nas5w
Husband, dog dad, coffee monster. Software engineer at the @usds! Opinions are my own

TOPICS

THIS ARTICLE WAS FEATURED IN...

Permanent on Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite
Bitcoininsider