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

Function loadRepo

examples/real-world/src/actions/index.js:44–51  ·  view source on GitHub ↗
(fullName, requiredFields = [])

Source from the content-addressed store, hash-verified

42// Fetches a single repository from Github API unless it is cached.
43// Relies on Redux Thunk middleware.
44export const loadRepo = (fullName, requiredFields = []) => (dispatch, getState) => {
45 const repo = getState().entities.repos[fullName]
46 if (repo && requiredFields.every(key => repo.hasOwnProperty(key))) {
47 return null
48 }
49
50 return dispatch(fetchRepo(fullName))
51}
52
53export const STARRED_REQUEST = 'STARRED_REQUEST'
54export const STARRED_SUCCESS = 'STARRED_SUCCESS'

Callers

nothing calls this directly

Calls 3

getStateFunction · 0.85
fetchRepoFunction · 0.85
dispatchFunction · 0.50

Tested by

no test coverage detected