Skip to content

Instantly share code, notes, and snippets.

@alex35mil
Last active March 17, 2017 11:27
Show Gist options
  • Save alex35mil/64e9ffb7345b1630202b2cd6ac581e31 to your computer and use it in GitHub Desktop.
Save alex35mil/64e9ffb7345b1630202b2cd6ac581e31 to your computer and use it in GitHub Desktop.
// Action creator: returns request action
const requestAction = postId => ({
type: 'POST_DELETE_REQUESTED',
postId,
});
// Action handler: reduces the state of the single leaf
const onRequest = {
POST_DELETE_REQUESTED:
(state, { postId }) =>
state.update('processingPosts', processingPosts => processingPosts.add(postId)),
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment