MCPcopy
hub / github.com/reduxjs/redux / fetchPostsIfNeeded

Function fetchPostsIfNeeded

examples/async/src/actions/index.js:46–50  ·  examples/async/src/actions/index.js::fetchPostsIfNeeded

Source from the content-addressed store, hash-verified

44}
45
46export const fetchPostsIfNeeded = subreddit => (dispatch, getState) => {
47 if (shouldFetchPosts(getState(), subreddit)) {
48 return dispatch(fetchPosts(subreddit))
49 }
50}

Callers 3

componentDidMountFunction · 0.90
componentDidUpdateFunction · 0.90
App.jsFile · 0.90

Calls 4

shouldFetchPostsFunction · 0.85
getStateFunction · 0.85
fetchPostsFunction · 0.85
dispatchFunction · 0.50

Tested by

no test coverage detected