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

Function loadStargazers

examples/real-world/src/actions/index.js:102–113  ·  view source on GitHub ↗
(fullName, nextPage)

Source from the content-addressed store, hash-verified

100// Bails out if page is cached and user didn't specifically request next page.
101// Relies on Redux Thunk middleware.
102export const loadStargazers = (fullName, nextPage) => (dispatch, getState) => {
103 const {
104 nextPageUrl = `repos/${fullName}/stargazers`,
105 pageCount = 0
106 } = getState().pagination.stargazersByRepo[fullName] || {}
107
108 if (pageCount > 0 && !nextPage) {
109 return null
110 }
111
112 return dispatch(fetchStargazers(fullName, nextPageUrl))
113}
114
115export const RESET_ERROR_MESSAGE = 'RESET_ERROR_MESSAGE'
116

Callers

nothing calls this directly

Calls 3

getStateFunction · 0.85
fetchStargazersFunction · 0.85
dispatchFunction · 0.50

Tested by

no test coverage detected