Skip to content

Instantly share code, notes, and snippets.

@nparsons08 nparsons08/selectors.js Secret forked from LukeSmetham/selectors.js
Created Sep 24, 2019

Embed
What would you like to do?
import { createSelector } from 'reselect';
const getAuth = (state) => state.auth;
export const makeSelectCurrentUser = () =>
createSelector(
getAuth,
({ user }) => user,
);
export const makeSelectStreamToken = () =>
createSelector(
getAuth,
({ streamToken }) => streamToken,
);
export const makeSelectIsAuthed = () =>
createSelector(
makeSelectCurrentUser(),
(user) => !!user,
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.