Skip to content

Instantly share code, notes, and snippets.

@alexfedoseev alexfedoseev/request.js
Last active Mar 17, 2017

Embed
What would you like to do?
// 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
You can’t perform that action at this time.