Skip to content

Commit

Permalink
added missing invalidateSubreddit action
Browse files Browse the repository at this point in the history
invalidateSubreddit function and its constant were missing in the actions.js after async functions changes introduced.
  • Loading branch information
ahmetcetin authored Aug 7, 2017
1 parent 44bfeee commit 82c84ac
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions docs/advanced/AsyncActions.md
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,14 @@ function receivePosts(subreddit, json) {
}
}

export const INVALIDATE_SUBREDDIT = 'INVALIDATE_SUBREDDIT'
export function invalidateSubreddit(subreddit) {
return {
type: INVALIDATE_SUBREDDIT,
subreddit
}
}

// Meet our first thunk action creator!
// Though its insides are different, you would use it just like any other action creator:
// store.dispatch(fetchPosts('reactjs'))
Expand Down Expand Up @@ -442,6 +450,14 @@ function receivePosts(subreddit, json) {
}
}

export const INVALIDATE_SUBREDDIT = 'INVALIDATE_SUBREDDIT'
export function invalidateSubreddit(subreddit) {
return {
type: INVALIDATE_SUBREDDIT,
subreddit
}
}

function fetchPosts(subreddit) {
return dispatch => {
dispatch(requestPosts(subreddit))
Expand Down

0 comments on commit 82c84ac

Please sign in to comment.