Comparing version 7.1.2 to 7.1.3
{ | ||
"name": "fluture", | ||
"version": "7.1.2", | ||
"version": "7.1.3", | ||
"description": "FantasyLand compliant (monadic) alternative to Promises", | ||
@@ -61,8 +61,8 @@ "main": "index.js", | ||
"benchmark": "^2.1.0", | ||
"chai": "^4.0.0", | ||
"chai": "^4.1.2", | ||
"codecov": "^2.2.0", | ||
"data.task": "^3.0.0", | ||
"eslint": "^4.1.1", | ||
"eslint": "^4.7.2", | ||
"eslint-config-warp": "^2.0.0", | ||
"eslint-plugin-markdown": "^1.0.0-beta.6", | ||
"eslint-plugin-markdown": "^1.0.0-beta.7", | ||
"fantasy-land": "^3.0.0", | ||
@@ -72,5 +72,5 @@ "fantasy-states": "^0.2.1", | ||
"istanbul": "^0.4.5", | ||
"jsverify": "^0.8.2", | ||
"jsverify": "^0.8.3", | ||
"lodash.curry": "^4.1.1", | ||
"mocha": "^3.4.1", | ||
"mocha": "^3.5.3", | ||
"ramda": "^0.24.0", | ||
@@ -80,12 +80,12 @@ "ramda-fantasy": "^0.8.0", | ||
"remark-validate-links": "^7.0.0", | ||
"rimraf": "^2.4.3", | ||
"rimraf": "^2.6.2", | ||
"rollup": "^0.47.6", | ||
"rollup-plugin-buble": "^0.15.0", | ||
"rollup-plugin-commonjs": "^8.1.0", | ||
"rollup-plugin-buble": "^0.16.0", | ||
"rollup-plugin-commonjs": "^8.2.1", | ||
"rollup-plugin-istanbul": "^1.1.0", | ||
"rollup-plugin-multi-entry": "^2.0.1", | ||
"rollup-plugin-node-resolve": "^3.0.0", | ||
"source-map-support": "^0.4.14", | ||
"source-map-support": "^0.4.18", | ||
"xyz": "^2.0.1" | ||
} | ||
} |
@@ -28,2 +28,3 @@ # [![Fluture](logo.png)](#butterfly) | ||
* [Wiki: Compare Futures to Promises][wiki:promises] | ||
* [Article: Why Promises shouldn't be used][10] | ||
* [Wiki: Compare Fluture to similar libraries][wiki:similar] | ||
@@ -1188,7 +1189,7 @@ * [Video: Monad a Day by @DrBoolean - Futures][5] | ||
```js | ||
const instableFutures = Array.from({length: 4}, (_, i) => | ||
const unstableFutures = Array.from({length: 4}, (_, i) => | ||
Future.node(done => done(Math.random() > 0.75 ? 'failed' : null, i)) | ||
); | ||
const stabalizedFutures = instableFutures.map(Future.fold(S.Left, S.Right)); | ||
const stabalizedFutures = unstableFutures.map(Future.fold(S.Left, S.Right)); | ||
@@ -1322,3 +1323,3 @@ Future.parallel(Infinity, stabalizedFutures).fork(console.error, console.log); | ||
Allows a Future-returning function to be decorated with resource acquistion | ||
Allows a Future-returning function to be decorated with resource acquisition | ||
and disposal. The signature is like `hook(acquire, dispose, consume)`, where | ||
@@ -1591,1 +1592,2 @@ `acquire` is a Future which might create connections, open file handlers, etc. | ||
[9]: http://wearereasonablepeople.nl/ | ||
[10]: https://medium.com/@avaq/broken-promises-2ae92780f33 |
import {Core} from './core'; | ||
import {noop, show, showf, immediately, partial1} from './internal/fn'; | ||
import {show, showf, immediately, partial1} from './internal/fn'; | ||
import {isThenable, isFunction} from './internal/is'; | ||
@@ -23,4 +23,15 @@ import {invalidArgument, typeError} from './internal/throw'; | ||
const {_fn, _a} = this; | ||
check$promise(_fn(_a), _fn, _a).then(immediately(res), immediately(rej)); | ||
return noop; | ||
let open = true; | ||
check$promise(_fn(_a), _fn, _a).then(immediately(function EncaseP$res(x){ | ||
if(open){ | ||
open = false; | ||
res(x); | ||
} | ||
}), immediately(function EncaseP$rej(x){ | ||
if(open){ | ||
open = false; | ||
rej(x); | ||
} | ||
})); | ||
return function EncaseP$cancel(){ open = false }; | ||
}; | ||
@@ -27,0 +38,0 @@ |
import {Core} from './core'; | ||
import {noop, show, showf, immediately, partial1, partial2} from './internal/fn'; | ||
import {show, showf, immediately, partial1, partial2} from './internal/fn'; | ||
import {isThenable, isFunction} from './internal/is'; | ||
@@ -25,4 +25,15 @@ import {invalidArgument, typeError} from './internal/throw'; | ||
const {_fn, _a, _b} = this; | ||
check$promise(_fn(_a, _b), _fn, _a, _b).then(immediately(res), immediately(rej)); | ||
return noop; | ||
let open = true; | ||
check$promise(_fn(_a, _b), _fn, _a, _b).then(immediately(function EncaseP2$res(x){ | ||
if(open){ | ||
open = false; | ||
res(x); | ||
} | ||
}), immediately(function EncaseP2$rej(x){ | ||
if(open){ | ||
open = false; | ||
rej(x); | ||
} | ||
})); | ||
return function EncaseP2$cancel(){ open = false }; | ||
}; | ||
@@ -29,0 +40,0 @@ |
import {Core} from './core'; | ||
import {noop, show, showf, immediately, partial1, partial2, partial3} from './internal/fn'; | ||
import {show, showf, immediately, partial1, partial2, partial3} from './internal/fn'; | ||
import {isThenable, isFunction} from './internal/is'; | ||
@@ -27,4 +27,15 @@ import {invalidArgument, typeError} from './internal/throw'; | ||
const {_fn, _a, _b, _c} = this; | ||
check$promise(_fn(_a, _b, _c), _fn, _a, _b, _c).then(immediately(res), immediately(rej)); | ||
return noop; | ||
let open = true; | ||
check$promise(_fn(_a, _b, _c), _fn, _a, _b, _c).then(immediately(function EncaseP3$res(x){ | ||
if(open){ | ||
open = false; | ||
res(x); | ||
} | ||
}), immediately(function EncaseP3$rej(x){ | ||
if(open){ | ||
open = false; | ||
rej(x); | ||
} | ||
})); | ||
return function EncaseP3$cancel(){ open = false }; | ||
}; | ||
@@ -31,0 +42,0 @@ |
import {Core} from './core'; | ||
import {noop, show, showf, immediately} from './internal/fn'; | ||
import {show, showf, immediately} from './internal/fn'; | ||
import {isThenable, isFunction} from './internal/is'; | ||
@@ -21,4 +21,15 @@ import {invalidArgument, typeError} from './internal/throw'; | ||
const {_fn} = this; | ||
check$promise(_fn(), _fn).then(immediately(res), immediately(rej)); | ||
return noop; | ||
let open = true; | ||
check$promise(_fn(), _fn).then(immediately(function TryP$res(x){ | ||
if(open){ | ||
open = false; | ||
res(x); | ||
} | ||
}), immediately(function TryP$rej(x){ | ||
if(open){ | ||
open = false; | ||
rej(x); | ||
} | ||
})); | ||
return function TryP$cancel(){ open = false }; | ||
}; | ||
@@ -25,0 +36,0 @@ |
Sorry, the diff of this file is too big to display
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
209021
4024
1590