Comparing version 1.0.0 to 1.0.1
@@ -720,10 +720,12 @@ //// ____ _ _ | ||
check$do(f); | ||
const g = f(); | ||
check$do$g(g); | ||
const next = function Future$do$next(x){ | ||
const o = g.next(x); | ||
check$do$next(o); | ||
return o.done ? Future$of(o.value) : o.value.chain(next); | ||
}; | ||
return next(); | ||
return new FutureClass(function Future$do$fork(rej, res){ | ||
const g = f(); | ||
check$do$g(g); | ||
const next = function Future$do$next(x){ | ||
const o = g.next(x); | ||
check$do$next(o); | ||
return o.done ? Future$of(o.value) : o.value.chain(Future$do$next); | ||
}; | ||
return next().fork(rej, res); | ||
}); | ||
}; | ||
@@ -730,0 +732,0 @@ |
{ | ||
"name": "fluture", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "A mathematically correct alternative to Promises for asynchronous control flow", | ||
@@ -65,7 +65,7 @@ "main": "fluture.js", | ||
"pacta": "^0.9.0", | ||
"ramda": "^0.20.1", | ||
"ramda": "^0.21.0", | ||
"ramda-fantasy": "^0.4.1", | ||
"rimraf": "^2.4.3", | ||
"sanctuary": "^0.9.1" | ||
"sanctuary": "^0.10.0" | ||
} | ||
} |
@@ -101,4 +101,4 @@ # Fluture | ||
parameter `fork`: A function which takes two callbacks. Both are continuations | ||
for an asynchronous computation. The first is `reject`, commonly abreviated to | ||
`rej`. The second `resolve`, which abreviates to `res`. The `fork` function is | ||
for an asynchronous computation. The first is `reject`, commonly abbreviated to | ||
`rej`. The second `resolve`, which abbreviates to `res`. The `fork` function is | ||
expected to call `rej` once an error occurs, or `res` with the result of the | ||
@@ -310,3 +310,3 @@ asynchronous computation. | ||
Future.of(1) | ||
.bimap(x => x + !, x => x + 1) | ||
.bimap(x => x + '!', x => x + 1) | ||
.fork(console.error, console.log); | ||
@@ -316,3 +316,3 @@ //> 2 | ||
Future.reject('error') | ||
.bimap(x => x + !, x => x + 1) | ||
.bimap(x => x + '!', x => x + 1) | ||
.fork(console.error, console.log); | ||
@@ -368,3 +368,3 @@ //> "error!" | ||
Race two Futures against eachother. Creates a new Future which resolves or | ||
Race two Futures against each other. Creates a new Future which resolves or | ||
rejects with the resolution or rejection value of the first Future to settle. | ||
@@ -383,3 +383,3 @@ | ||
Returns a new Future which either resolves with the first resolutation value, or | ||
Returns a new Future which either resolves with the first resolution value, or | ||
rejects with the last rejection value once and if both Futures reject. | ||
@@ -586,5 +586,8 @@ | ||
A specialized version of [fantasy-do][19] which works only for Futures, but has | ||
the advantage of type-checking and not having to pass `Future.of`. | ||
the advantage of type-checking and not having to pass `Future.of`. Another | ||
advantage is that the returned Future can be forked multiple times, as opposed | ||
to with a general `fantasy-do` solution, where forking the Future a second time | ||
behaves erroneously. | ||
Takes a function which returns an [Iterator][#type-signatures], commonly a | ||
Takes a function which returns an [Iterator](#type-signatures), commonly a | ||
generator-function, and chains every produced Future over the previous. | ||
@@ -591,0 +594,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
45730
636
658