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

Function loadStarred

examples/real-world/src/actions/index.js:71–82  ·  view source on GitHub ↗
(login, nextPage)

Source from the content-addressed store, hash-verified

69// Bails out if page is cached and user didn't specifically request next page.
70// Relies on Redux Thunk middleware.
71export const loadStarred = (login, nextPage) => (dispatch, getState) => {
72 const {
73 nextPageUrl = `users/${login}/starred`,
74 pageCount = 0
75 } = getState().pagination.starredByUser[login] || {}
76
77 if (pageCount > 0 && !nextPage) {
78 return null
79 }
80
81 return dispatch(fetchStarred(login, nextPageUrl))
82}
83
84export const STARGAZERS_REQUEST = 'STARGAZERS_REQUEST'
85export const STARGAZERS_SUCCESS = 'STARGAZERS_SUCCESS'

Callers 1

loadDataFunction · 0.90

Calls 3

getStateFunction · 0.85
fetchStarredFunction · 0.85
dispatchFunction · 0.50

Tested by

no test coverage detected