How to use the isomorphic-fetch.Promise 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 Tandemly / eos-api-service / src / api / utils / eosd.js View on Github external
/* eslint-disable no-bitwise */
const fetch = require('isomorphic-fetch');
const { uniq, map, flatMap } = require('lodash');
const { eosd } = require('../../config/vars');
const { formatISO } = require('../utils/helpers');

fetch.Promise = require('bluebird');

const defaults = {
  method: 'GET',
  headers: {
    'Content-Type': 'application/json',
  },
};

// Grab the correct, sorted sceope from the list of messages
// intended for a transaction
const getScope = messages =>
  uniq(
    flatMap(messages, msg => [msg.code, ...map(msg.authorization, auth => auth.account)]),
  ).sort();

const request = async (path, options = {}) => {
github gabrielboliveira / tracking-correios / src / services / correios.js View on Github external
'use strict'

const Promise = require("bluebird")

const fetch = require('isomorphic-fetch')
fetch.Promise = Promise

const _extend = require('lodash.assignin')
const _get = require('lodash.get')
const _chunk = require('lodash.chunk')
const _flatten = require('lodash.flatten')

const xml2js = require('xml2js')

const Helpers = require('../utils/helpers')

const TrackingError = require('../errors/tracking')

const parseXMLString = xml2js.parseString

const url = 'https://webservice.correios.com.br/service/rastro'