Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@promises/is-promise

yisraelx4MIT0.5.0TypeScript support: included

Is Promise is package from Promises library

promise, promises, utilities, utility, utils, modules, modular, async, await, deferred

readme

@promises/is-promise

Source Code Version MIT License Bundle Size

Is Promise is package from Promises library

Use

Module

$ npm install --save @promises/is-promise
import {
 default as isPromise
} from '@promises/is-promise';

Browser

<script src="https://unpkg.com/@promises/is-promise/bundle.umd.min.js"></script>
let {
 isPromise
} = P;

Examples

 let promise: Promise<string> = Promise.resolve('foo');

 console.log(isPromise(promises)); // => true
 console.log(isPromise('foo')); // => false

Wrapper

Module

$ npm install --save @promises/is-promise
import Promises from '@promises/core';
import '@promises/is-promise/add';

Or

import Promises from '@promises/is-promise/add';

Browser

<script src="https://unpkg.com/@promises/core/bundle.umd.min.js"></script>
<script src="https://unpkg.com/@promises/is-promise/add/bundle.umd.min.js"></script>
let {
 Promises
} = P;

Examples

 let promises: Promises<string> = Promises.resolve('foo');
 console.log(Promises.isPromise(promises)); // => true
 console.log(Promises.isPromise('foo')); // => false

Compatibility

These modules are written in typescript and available in ES5 and ES6 standard, the requirements are a global Promise (native or polyfill).

License

Copyright © 2017 Yisrael Eliav, Licensed under the MIT license.

changelog

Change Log

All notable changes to this project will be documented in this file. See Conventional Commits for commit guidelines.

0.5.0 (2018-07-16)

build

  • move from webpack to rollup, compatibility changes (47594dc)

Code Refactoring

  • separates add and export, adds 'add' file to groups packages (be1e7f6)

Features

  • add Tree-Shaking & esm support and convert "add" to sub-package (0aa2297)

BREAKING CHANGES

  • change in wrapper use, for use in wrapper:
    import Promises from '@promises/-all/add';
    Or
    import Promises from '@promises/core';
    import '@promises/-all/add';
  • new compatibility support:
  • main - commonjs module and es5 standard (index.js)
  • es2015 - commonjs module and es2015 standard (index.es6.js)
  • browser - bundle in umd format includes all scope dependencies in es5 standard (bundle.umd.js, bundle.umd.min.js)
  • typings - typescript declaration file (index.d.ts)
  • "add" does not export the "index" export, it only adds to Promises
    import Promises from '@promises/core';
    import '@promises/for-each-series/add';

0.3.1 (2018-03-05)

Note: Version bump only for package @promises/is-promise

0.3.0 (2018-03-05)

Chores

  • package: change of the export properties (main, browser, module, es2015) (5a146dc)

Features

  • change packages architecture and giving independence to modules/methods (832216b)

BREAKING CHANGES

  • standalone methods return 'Promise' instead of 'Promises'

before

import method from '@promises/method';
let promises: Promises<any> = method<any>();

after

import method from '@promises/method';
let promise: Promise<any> = method<any>();

for Promises use Promises

import Promises from '@promises/-all';

let promises: Promises<any> = Promises.method<any>();

changing the architecture of loading methods to 'Promises'

before

import Promises from '@promises/core';
import method from '@promises/method';

method()
Promise.method()
import Promises from '@promises/core';
import '@promises/method';

Promise.method()

after

import
Promises from '@promises/core';
import method from '@promises/method';

method()
Promise.method() // throw Error
import Promises from '@promises/core';
import method from'@promises/method/add';

method()
Promise.method()
  • package: change properties:
  • main: umd.js => es5.js
  • browser: umd.js => umd.min.js
  • module: es5.js => index.js
  • bundle: bundle.js => bundle.min.js

0.2.0 (2017-09-20)

Note: Version bump only for package @promises/is-promise

0.1.0 (2017-06-24)

Features