How to use the isomorphic-fetch.default function in isomorphic-fetch

To help you get started, we’ve selected a few isomorphic-fetch 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 MacroConnections / DIVE-frontend / src / js / actions / api.js View on Github external
return dispatch => {
    return isomorphicFetch(completeUrl, {})
      .then(response => response.json())
      .then(function(data) {
        if (data.state == 'SUCCESS') {
          taskManager.removeTask(taskId);
          dispatch(dispatcher(dispatcherParams, data.result));
        } else if (data.state == 'FAILURE') {
          taskManager.removeTask(taskId);
          console.error(data.error);
          Raven.captureException(new Error(data.error));
          dispatch(errorDispatcher(data));
        } else if (counter > limit) {
          revokeTasks(taskId).then((revokeData) => {
            dispatch(dispatcher(dispatcherParams, { ...data.result, error: 'Took too long to get visualizations.' }));
          });
        } else {
          if (progressDispatcher && data.currentTask) {
github MacroConnections / DIVE-frontend / src / js / actions / api.js View on Github external
export function rawFetch(urlPath, options) {
  const completeUrl = API_URL + urlPath;
  return isomorphicFetch(completeUrl, { ...options, credentials: 'include' });
}
github linode / manager / _src / fetch.js View on Github external
export function rawFetch(...args) {
  return isomorphicFetch['default'](...args);
}
github MacroConnections / DIVE-frontend / src / js / actions / api.js View on Github external
function revokeTasks(taskIds) {
  const completeUrl = API_URL + '/tasks/v1/revoke';

  var options = {
    headers: { 'Content-Type': 'application/json' },
    method: 'post',
    body: JSON.stringify({ 'task_ids': taskIds })
  };

  taskManager.removeTasks(taskIds);

  return isomorphicFetch(completeUrl, options).then(response => response.json());
}