Skip to content
This repository has been archived by the owner on Jul 25, 2018. It is now read-only.

fantasyland/fantasy-promises

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published