Skip to content

Instantly share code, notes, and snippets.

@malectro
Last active May 18, 2017 18:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save malectro/bfa1533b7476d9da4d4fae924bb7e1ac to your computer and use it in GitHub Desktop.
Save malectro/bfa1533b7476d9da4d4fae924bb7e1ac to your computer and use it in GitHub Desktop.
const getUser = flow([
key(userId => `@@getUser:${userId}`),
fetching(),
cached({ttl: 60000}),
])(userId =>
api.get(`/user/${userId}`).then(user =>
dispatch(receiveUser(user))
)
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment