Skip to content

return promise #51

Open
Open

Description

@xianfcn

hello, can jsonp function return new promise ?

Activity

  1. DigitalBrainJS commented on Dec 4, 2018

    @DigitalBrainJS

    Seems it can't, but you can write your own wrapped function like following:
    const jsonpFetch = (url, options) => new Promise((resolve, reject) => jsonp(url, options, (err, data) => err ? reject(err) : resolve(data)));
    ...or just use some another jsonp package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions