Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- export const loadPosts = posts => ({
- type: ACTIONS.LOAD_POSTS,
- posts
- });
- export const sortPostsBy = field => ({
- type: ACTIONS.SORT_POSTS_BY,
- field
- });
- export const filterPostsBy = category => ({
- type: ACTIONS.FILTER_POSTS_BY,
- category
- });
- export const addPost = post => ({
- type: ACTIONS.ADD_POST,
- post
- });
- export const updatePost = (postId, updatedFields) => ({
- type: ACTIONS.UPDATE_POST,
- postId,
- updatedFields
- });
- export const deletePost = postId => ({
- type: ACTIONS.DELETE_POST,
- postId
- });
- export const updatePostVoteScore = (postId, voteScore) => ({
- type: ACTIONS.UPDATE_POST_VOTE_SCORE,
- postId,
- voteScore
- });
- export const updateCommentCount = (parentId, commentCount) => ({
- type: ACTIONS.UPDATE_COMMENT_COUNT,
- parentId,
- commentCount
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement