Advertisement
Guest User

Untitled

a guest
Jan 20th, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. export const loadPosts = posts => ({
  2.   type: ACTIONS.LOAD_POSTS,
  3.   posts
  4. });
  5.  
  6. export const sortPostsBy = field => ({
  7.   type: ACTIONS.SORT_POSTS_BY,
  8.   field
  9. });
  10.  
  11. export const filterPostsBy = category => ({
  12.   type: ACTIONS.FILTER_POSTS_BY,
  13.   category
  14. });
  15.  
  16. export const addPost = post => ({
  17.   type: ACTIONS.ADD_POST,
  18.   post
  19. });
  20.  
  21. export const updatePost = (postId, updatedFields) => ({
  22.   type: ACTIONS.UPDATE_POST,
  23.   postId,
  24.   updatedFields
  25. });
  26.  
  27. export const deletePost = postId => ({
  28.   type: ACTIONS.DELETE_POST,
  29.   postId
  30. });
  31.  
  32. export const updatePostVoteScore = (postId, voteScore) => ({
  33.   type: ACTIONS.UPDATE_POST_VOTE_SCORE,
  34.   postId,
  35.   voteScore
  36. });
  37.  
  38. export const updateCommentCount = (parentId, commentCount) => ({
  39.   type: ACTIONS.UPDATE_COMMENT_COUNT,
  40.   parentId,
  41.   commentCount
  42. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement