reselect
reselect (https://github.com/reduxjs/reselect) is an external library for Redux that helps to build selectors. The library has become de-facto standards for creating selectors in the frontend echo-system.
In our application, one of the use cases where we need to use a selector is to store login information about the user. If a user signs in using credentials, we create a session for the user for a certain interval. This is very basics of authentication and authorization mechanisms. Let's say, if a user has entered the credentials correctly, then we save a isLoggedIn flag in store to indicate the user is logged in. Every time a user opens our application, we try to check for these props, and if it is true, we redirect the user to ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access