Skip to content

Instantly share code, notes, and snippets.

@guillaumewuip
Created February 20, 2020 07:56
Show Gist options
  • Save guillaumewuip/130ef040fbe4f021db0e1017cbf4d03d to your computer and use it in GitHub Desktop.
Save guillaumewuip/130ef040fbe4f021db0e1017cbf4d03d to your computer and use it in GitHub Desktop.
How to model your entities - 8
import { Option, fold } from ‘fp-ts/lib/Option`;
const user: Option<User> = … // ie. None | Some<User>
return fold(
() => <p>oops, no user!</p>,
(user: User) => <UserView user={user} />,
)(user);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment