🚀 DAY 5 OF LAUNCH WEEK: Introducing Socket Firewall Enterprise.Learn more →
Socket
Book a DemoInstallSign in
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

latest
Source
npmnpm
Version
0.1.0
Version published
Weekly downloads
73
65.91%
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

promise

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