Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

fantasy-promises

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fantasy-promises

Fantasy Land compatible monadic promises

  • 0.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
42
increased by147.06%
Maintainers
1
Weekly downloads
 
Created
Source

Fantasy Promises

This library implements purely functional, monadic promises.

Promise(fork)

Promise is a constructor which takes a fork function. The fork function takes one argument:

fork(resolve)

The resolve callback gets called on a value.

Promise.of(x)

Creates a Promise that contains a successful value.

chain(f)

Returns a new promise that evaluates f when the current promise is successfully fulfilled. f must return a new promise.

map(f)

Returns a new promise that evaluates f on a value and passes it through to the resolve function.

extract()

Executes a promise to get a value.

extend(f)

Returns a new promise that evaluates f over the promise to get a value.

Fantasy Land Compatible

Keywords

FAQs

Package last updated on 09 Jul 2013

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc