MCPcopy Index your code
hub / github.com/heroku/react-refetch / createInitialPromiseState

Method createInitialPromiseState

src/components/connect.js:326–340  ·  view source on GitHub ↗
(prop, mapping)

Source from the content-addressed store, hash-verified

324 }
325
326 createInitialPromiseState(prop, mapping) {
327 return (meta) => {
328 if (typeof mapping.refreshing == 'function') {
329 const current = this.state.data[prop]
330 if (current) {
331 current.value = mapping.refreshing(current.value)
332 }
333 return PromiseState.refresh(current, meta)
334 } else if (mapping.refreshing) {
335 return PromiseState.refresh(this.state.data[prop], meta)
336 } else {
337 return PromiseState.create(meta)
338 }
339 }
340 }
341
342 createPromiseStateOnFulfillment(prop, mapping, startedAt) {
343 return (meta) => {

Callers 1

createPromiseMethod · 0.95

Calls 2

refreshMethod · 0.65
createMethod · 0.65

Tested by

no test coverage detected