Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
payload: (action, state, res) => {
return getJSON(res).then((json) => {
// Resolve the passed in promise, if supplied
if (get(promiseHandler, 'promise._deferreds.length')) {
// We need to ensure that the promise resolves AFTER the redux store has been
// updated, so pass it off to the next tick
const shouldResolve = promiseHandler && promiseHandler.resolve
shouldResolve && setImmediate(() => promiseHandler.resolve())
}
return {
requestType: requestType,
responseData: dataParser(json)
}
})
}
}, {
payload: (_action, _state, res) => {
// @ts-ignore null
return getJSON(res).then((json) => json.results)
}
},
payload: /* istanbul ignore next */ (action, state, res) => {
return getJSON(res)
.then((json) => normalize(json, Schemas.CONVO_ARRAY));
}
},
payload: (_action, _state, res) =>
// @ts-ignore
getJSON(res).then(phraseList => ({
docId,
// @ts-ignore any
phraseList: phraseList.map(phrase => ({
...phrase,
status: transUnitStatusToPhraseStatus(phrase.status)
}))
})),
meta: { filter: filtered }
payload: (action, state, res) =>
getJSON(res).then(phraseList => ({
docId,
phraseList: phraseList.map(phrase => ({
...phrase,
status: transUnitStatusToPhraseStatus(phrase.status)
}))
})),
meta: { filter: filtered }
payload: (action, state, res) => getJSON(res)
.then(details => transUnitDetailToPhraseDetail(details, locale))
},
export default function (json) {
return getJSON(json).then((data) => {
let normalized = null
let meta = null
if (data) {
var humped = humps.camelizeKeys(data)
meta = humped.meta
normalized = normalize(humped)
}
return { ...normalized, meta }
})
}
payload: (action, state, res) => {
return getJSON(res).then(errorInterceptor)
}
}],
payload: (_action, _state, res) => getJSON(res)
.then(details => transUnitDetailToPhraseDetail(details, locale))
},
payload: (action, state, res) => getJSON(res),
meta: { isPro }