jsonp.js 392 Bytes
import fetchJsonp from 'fetch-jsonp'

module.exports = function (uri, option) {
    return new Promise(resolve => {
        fetchJsonp(uri)
            .then(function (response) {
                return response.json()
            }).then(function (json) {
            return resolve(json)
        }).catch(function (ex) {
            return resolve({code: 202, data: ex})
        })
    })
}