How to use the redux-api-middleware.getJSON function in redux-api-middleware

To help you get started, we’ve selected a few redux-api-middleware examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Patreon / nion / actions / request-types.js View on Github external
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)
                }
            })
        }
    }, {
github zanata / zanata-platform / server / zanata-frontend / src / app / actions / version-actions.js View on Github external
payload: (_action, _state, res) => {
        // @ts-ignore null
        return getJSON(res).then((json) => json.results)
      }
    },
github tylercrosse / gitter-clone / src / common / actions / index.js View on Github external
payload: /* istanbul ignore next */ (action, state, res) => {
          return getJSON(res)
            .then((json) => normalize(json, Schemas.CONVO_ARRAY));
        }
      },
github zanata / zanata-platform / server / zanata-frontend / src / app / editor / watchers / phrase-list.js View on Github external
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 }
github zanata / zanata-platform / server / zanata-frontend / src / frontend / app / editor / watchers / phrase-list.js View on Github external
payload: (action, state, res) =>
            getJSON(res).then(phraseList => ({
              docId,
              phraseList: phraseList.map(phrase => ({
                ...phrase,
                status: transUnitStatusToPhraseStatus(phrase.status)
              }))
            })),
          meta: { filter: filtered }
github zanata / zanata-platform / server / zanata-frontend / src / frontend / app / editor / watchers / phrase-detail.js View on Github external
          payload: (action, state, res) => getJSON(res)
            .then(details => transUnitDetailToPhraseDetail(details, locale))
        },
github streamr-app / streamr-web / src / utils / deserialize.js View on Github external
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 }
  })
}
github streamr-app / streamr-web / src / actions / index.js View on Github external
payload: (action, state, res) => {
            return getJSON(res).then(errorInterceptor)
          }
        }],
github zanata / zanata-platform / server / zanata-frontend / src / app / editor / watchers / phrase-detail.js View on Github external
          payload: (_action, _state, res) => getJSON(res)
            .then(details => transUnitDetailToPhraseDetail(details, locale))
        },
github manosim / trevor / App / Actions / index.js View on Github external
        payload: (action, state, res) => getJSON(res),
        meta: { isPro }