How to use the pinkie-promise function in pinkie-promise

To help you get started, we’ve selected a few pinkie-promise 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 futurize / futurize / test / futurize-promise.js View on Github external
function time (text, cb) {
    return new Promise((res, rej) =>
      setTimeout(() => res(text), 100)
    );
  }
github futurize / futurize / test / futurize-promise.js View on Github external
function erroring (text, cb) {
    return new Promise((res, rej) =>
      setTimeout(() => rej(text), 100)
    );
  }
github jfairbank / redux-resource / src / helpers / fetchResource / index.js View on Github external
export default function fetchResource(url, options = {}) {
  return new Promise((resolve, reject) => {
    options = assign({}, DEFAULT_OPTIONS, options);

    options.headers = assign(
      {},
      DEFAULT_HEADERS,
      normalizeHeaders(options.headers)
    );

    const data = serializeDataForContentType(
      options.data,
      options.headers['content-type']
    );

    const xhr = new XMLHttpRequest();

    xhr.open(options.method, url);

pinkie-promise

ES2015 Promise ponyfill

MIT
Latest version published 8 years ago

Package Health Score

67 / 100
Full package analysis