0.3.8 • Published 5 years ago

promise-ex v0.3.8

Weekly downloads
12
License
MIT
Repository
github
Last release
5 years ago

Px

Extension functions for JS Promise

https://nodei.co/npm/promise-ex.png?downloads=true&downloadRank=true&stars=true

JSDeliver Hits Build Status codecov HitCount

devDependencies Status

Introduction

Px allows the extension of the native Promise objects by adding additional functions to its prototype. Px also introduces two Promise variants:

  • DeferredPromise which is a Promise that, unlike a vanilla Promise, does not call the executor passed to its constructor synchronously but calls it whenever a callback is attached to it (so it produces a different Promise objects every call).

  • PublishedPromise, which allows asynchronous fulfillment.

Install

NPM

npm i promise-ex

then in NodeJs:

let Px = require('promise-ex');

CDN

<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/promise-ex@0.3.7/index.min.js"></script>

Example

Working example can be found at RunKit.

Changelogs

  • 0.3.6
    • Fixed delayedReject only resolving.
  • 0.3.5
    • AirBnb style
  • 0.3.0
    • Promise.test
    • Fix on comments
    • Fixed DeferredPromise.delay only resolving
  • 0.2.0
    • Delayed Resolve and Reject
  • 0.1.0
    • Initial Release

Build

First, run install the dependencies:

npm install

Run the test suite

npm test

You can also try generating the docs

npm run generate-docs

License

MIT License

Copyright (c) 2019 Alexis Munsayac

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

0.3.8

5 years ago

0.3.6

5 years ago

0.3.5

5 years ago

0.3.4

5 years ago

0.3.3

5 years ago

0.3.2

5 years ago

0.3.1

5 years ago

0.3.0

5 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.1.0

5 years ago

0.0.2

8 years ago

0.0.1

8 years ago