Socket
Socket
Sign inDemoInstall

@jasmith79/promiseplus

Package Overview
Dependencies
0
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @jasmith79/promiseplus

Promises with cancellation, timeout, lazy initialization.


Version published
Maintainers
1
Install size
492 kB
Created

Readme

Source

PromisePlus

NOTE: WIP

Adds a thenable with added capabilities: cancellation, timeouts, finally, lazy initialization, etc.

Rationale

Native Promises are slowly starting to gain some sorely needed abilities but remain inadequate even for their flagship use case (i.e. representing the value of an AJAX request). There are some great Promise libraries in existence like Bluebird, but Bluebird made some (totally reasonable) design decisions that aren't quite what I'm looking for. This is small and simple enough to get the job done, and has the slightly different semantics I wanted.

Drop the Burrito

Native Promises auto-flatten by default (you can't have a Promise of a Promise of a thing, it just becomes a Promise<Thing>). This is arguably a mistake, since it means Promises are not Monads and thus cannot be fed to code that expects that interface. Despite the disadvantages, I've kept the auto-flattening semantics for the sake of least surprise.

Keywords

FAQs

Last updated on 17 Sep 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc