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 6.2.6 to 6.2.7

src/internal/interpreter.js

6

package.json
{
"name": "fluture",
"version": "6.2.6",
"version": "6.2.7",
"description": "FantasyLand compliant (monadic) alternative to Promises",

@@ -63,3 +63,3 @@ "main": "index.js",

"data.task": "^3.0.0",
"eslint": "^3.0.1",
"eslint": "^4.0.0",
"eslint-config-warp": "^1.2.0",

@@ -79,3 +79,3 @@ "eslint-plugin-markdown": "^1.0.0-beta.6",

"rimraf": "^2.4.3",
"rollup": "^0.42.0",
"rollup": "^0.43.0",
"rollup-plugin-buble": "^0.15.0",

@@ -82,0 +82,0 @@ "rollup-plugin-istanbul": "^1.1.0",

@@ -5,3 +5,3 @@ import {show, showf, noop, moop} from './internal/fn';

import {$$type} from './internal/const';
import interpretor from './internal/interpretor';
import interpreter from './internal/interpreter';
import type from 'sanctuary-type-identifiers';

@@ -362,2 +362,33 @@

function Eager(future){
this.rej = noop;
this.res = noop;
this.rejected = false;
this.resolved = false;
this.value = null;
this.cancel = future._fork(x => {
this.value = x;
this.rejected = true;
this.cancel = noop;
this.rej(x);
}, x => {
this.value = x;
this.resolved = true;
this.cancel = noop;
this.res(x);
});
}
Eager.prototype = Object.create(Core);
Eager.prototype._fork = function Eager$_fork(rej, res){
if(this.rejected) rej(this.value);
else if(this.resolved) res(this.value);
else{
this.rej = rej;
this.res = res;
}
return this.cancel;
};
export class Action{

@@ -447,3 +478,3 @@ rejected(x){ this.cancel(); return new Rejected(x) }

constructor(other){ super(); this.other = other }
run(early){ return new RaceActionState(early, this.other) }
run(early){ return new RaceActionState(early, new Eager(this.other)) }
toString(){ return `race(${this.other.toString()})` }

@@ -459,3 +490,3 @@ }

constructor(other){ super(); this.other = other }
run(early){ return new BothActionState(early, this.other) }
run(early){ return new BothActionState(early, new Eager(this.other)) }
resolved(x){ return this.other._map(y => [x, y]) }

@@ -534,3 +565,3 @@ toString(){ return `both(${this.other.toString()})` }

Sequence.prototype._fork = interpretor;
Sequence.prototype._fork = interpreter;

@@ -537,0 +568,0 @@ Sequence.prototype.toString = function Sequence$toString(){

Sorry, the diff of this file is too big to display

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