Skip to content

Instantly share code, notes, and snippets.

@hasparus
Created November 14, 2019 19:13
Show Gist options
  • Save hasparus/85f13f30a001fac94aa700574269d711 to your computer and use it in GitHub Desktop.
Save hasparus/85f13f30a001fac94aa700574269d711 to your computer and use it in GitHub Desktop.
type Empty = undefined;
const Empty = undefined;
type Pending = 'Pending';
const Pending = 'Pending';
interface CrmUser {
domain: string;
}
type StoreState = {
crmData: CrmUser | Empty | Pending;
}
const selectDomain = ({ crmData }: StoreState) => crmData && crmData !== Pending ? crmData.domain : undefined;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment