Socket
Socket
Sign inDemoInstall

fluture

Package Overview
Dependencies
Maintainers
1
Versions
109
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fluture - npm Package Compare versions

Comparing version 0.5.4 to 0.5.5

test.js

21

fluture.js

@@ -159,2 +159,6 @@ /*global define*/

function check$promise(it){
if(!isFluture(it)) error$invalidContext('Future#promise', it);
}
function check$cache(m){

@@ -333,2 +337,10 @@ if(!isFluture(m)) error$invalidArgument('Future.cache', 0, 'be a Future', m);

function Future$promise(){
check$promise(this);
const _this = this;
return new Promise(function Future$promise$do(resolve, reject){
_this.fork(reject, resolve);
});
}
//Give Future a prototype.

@@ -352,3 +364,4 @@ FutureClass.prototype = Future.prototype = {

fold: Future$fold,
value: Future$value
value: Future$value,
promise: Future$promise
};

@@ -481,8 +494,10 @@

return new FutureClass(function Future$encase$fork(rej, res){
let y;
try{
res(f(x));
y = f(x);
}
catch(err){
rej(err);
return void rej(err);
}
res(y);
});

@@ -489,0 +504,0 @@ };

2

package.json
{
"name": "fluture",
"version": "0.5.4",
"version": "0.5.5",
"description": "A complete Fantasy Land compatible Future library",

@@ -5,0 +5,0 @@ "main": "fluture.js",

@@ -7,3 +7,2 @@ # Fluture

[![Code Coverage](https://codecov.io/github/Avaq/Fluture/coverage.svg?branch=develop)](https://codecov.io/github/Avaq/Fluture/fluture.js?branch=develop)
[![Code Quality](https://www.bithound.io/github/Avaq/Fluture/badges/score.svg)](https://www.bithound.io/github/Avaq/Fluture)

@@ -48,8 +47,8 @@ A complete [Fantasy Land][1] compatible Future library.

I've always liked Promises, and I've come to like Futures even more. Existing
implementations are a pain to debug though. I made this library in an effort to
provide **great error messages** when something goes wrong. I didn't want these
to come at the cost of performance though, so I made sure Fluture operates at
**high performance**. Throughout my work with Future's, I've created a lot of
**async control utilities** which I've decided to bundle with this library.
Existing implementations of Future are a pain to debug. This library was made in
an effort to provide **great error messages** when something goes wrong. The
library also comes bundled with many **async control utilities**. To prevent
these features from coming at the cost of performance, Fluture was optimized to
operate at **high performance**. For an overview of differences between Fluture
and other Future implementations, look at [this wiki article][15].

@@ -60,27 +59,16 @@ ## Documentation

I'm using [Hindley-Milner] type signatures to document functions. A list of all
types I'll use within these signatures follows.
[Hindley-Milner][9] type signatures are used to document functions. A list of
all types used within these signatures follows:
#### Forkable
- **Forkable** - Any Object with a `fork` method that takes at least two
arguments. This includes instances of Fluture, instances of Task from
[`data.task`][10] or instances of Future from [`ramda-fantasy`][11].
- **Future** - Instances of Future provided by Fluture.
- **Functor** - Any object that has a `map` method which satisfies the
[Fantasy Land Functor specification][12].
- **Chain** - Any object that has a `chain` method which satisfies the
[Fantasy Land Chain specification][13].
- **Apply** - Any object that has an `ap` method which satisfies the
[Fantasy Land Apply specification][14].
Any Object with a `fork` method that takes at least two arguments. This includes
instances of Fluture, instances of Task from [`data.task`][10] or instances of
Future from [`ramda-fantasy`][11].
#### Future
Instances of Future provided by Fluture.
#### Functor
Any object that has a `map` method which satisfies the [Fantasy Land Functor specification][12].
#### Chain
Any object that has a `chain` method which satisfies the [Fantasy Land Chain specification][13].
#### Apply
Any object that has an `ap` method which satisfies the [Fantasy Land Apply specification][14].
### Constructors

@@ -388,2 +376,8 @@

#### `promise :: Future a b ~> Promise b a`
Cast the Future to a Promise. This will cause the Future to be eagerly forked.
This is useful if some API wants you to give it a Promise. You shouldn't need
this method for anything else.
### Dispatcher API

@@ -488,3 +482,3 @@

* [ ] Implement Future.predicate
* [ ] Implement Future#promise
* [x] Implement Future#promise
* [x] Implement Future.cast

@@ -533,1 +527,2 @@ * [x] Implement Future.encase

[14]: https://github.com/fantasyland/fantasy-land#apply
[15]: https://github.com/Avaq/Fluture/wiki/Comparison-of-Future-Implementations
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