JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 19
  • Score
    100M100P100Q48341F
  • License BSD-3-Clause

Tiny Deferred for Client or Server

Package Exports

  • tiny-defer

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (tiny-defer) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

tiny-defer

Tiny Deferred for Client or Server

build status

Example

var deferred = require('tiny-defer');

function something () {
  var defer = deferred();

  setTimeout(function () {
    defer.resolve(true);
  }, 1000);
  
  return defer.promise;
}

something().then(function (arg) {
  console.log(arg); // true;
});

API

deferred()

Returns an unboxed Promise

How to use tiny-defer

tiny-defer can be loaded as a CommonJS or AMD module, or with a script tag which would create window.deferred.

License

Copyright (c) 2015 Jason Mulligan Licensed under the BSD-3 license