Comparing version 2.4.2 to 2.4.3
@@ -0,1 +1,15 @@ | ||
<a name="2.4.3"></a> | ||
## [2.4.3](https://github.com/staltz/xstream/compare/v2.4.2...v2.4.3) (2016-05-16) | ||
### Bug Fixes | ||
* **extra:** add safety check against nulls for next() etc ([cf82a8b](https://github.com/staltz/xstream/commit/cf82a8b)) | ||
### Performance Improvements | ||
* **debounce:** improve debounce speed/rate ([8bf7903](https://github.com/staltz/xstream/commit/8bf7903)) | ||
<a name="2.4.2"></a> | ||
@@ -2,0 +16,0 @@ ## [2.4.2](https://github.com/staltz/xstream/compare/v2.4.1...v2.4.2) (2016-05-13) |
@@ -23,8 +23,17 @@ "use strict"; | ||
ConcatProducer.prototype._n = function (t) { | ||
this.out._n(t); | ||
var u = this.out; | ||
if (!u) | ||
return; | ||
u._n(t); | ||
}; | ||
ConcatProducer.prototype._e = function (err) { | ||
this.out._e(err); | ||
var u = this.out; | ||
if (!u) | ||
return; | ||
u._e(err); | ||
}; | ||
ConcatProducer.prototype._c = function () { | ||
var u = this.out; | ||
if (!u) | ||
return; | ||
var streams = this.streams; | ||
@@ -36,3 +45,3 @@ streams[this.i]._remove(this); | ||
else { | ||
this.out._c(); | ||
u._c(); | ||
} | ||
@@ -39,0 +48,0 @@ }; |
@@ -22,6 +22,6 @@ "use strict"; | ||
}; | ||
DebounceOperator.prototype.clearTimer = function () { | ||
DebounceOperator.prototype.clearInterval = function () { | ||
var id = this.id; | ||
if (id !== null) { | ||
clearTimeout(id); | ||
clearInterval(id); | ||
} | ||
@@ -32,13 +32,25 @@ this.id = null; | ||
var _this = this; | ||
var u = this.out; | ||
if (!u) | ||
return; | ||
this.value = t; | ||
this.clearTimer(); | ||
this.id = setTimeout(function () { return _this.out._n(_this.value); }, this.dt); | ||
this.clearInterval(); | ||
this.id = setInterval(function () { | ||
_this.clearInterval(); | ||
u._n(t); | ||
}, this.dt); | ||
}; | ||
DebounceOperator.prototype._e = function (err) { | ||
this.clearTimer(); | ||
this.out._e(err); | ||
var u = this.out; | ||
if (!u) | ||
return; | ||
this.clearInterval(); | ||
u._e(err); | ||
}; | ||
DebounceOperator.prototype._c = function () { | ||
this.clearTimer(); | ||
this.out._c(); | ||
var u = this.out; | ||
if (!u) | ||
return; | ||
this.clearInterval(); | ||
u._c(); | ||
}; | ||
@@ -45,0 +57,0 @@ return DebounceOperator; |
@@ -19,5 +19,7 @@ "use strict"; | ||
DelayOperator.prototype._n = function (t) { | ||
var self = this; | ||
var u = this.out; | ||
if (!u) | ||
return; | ||
var id = setInterval(function () { | ||
self.out._n(t); | ||
u._n(t); | ||
clearInterval(id); | ||
@@ -27,5 +29,7 @@ }, this.dt); | ||
DelayOperator.prototype._e = function (err) { | ||
var self = this; | ||
var u = this.out; | ||
if (!u) | ||
return; | ||
var id = setInterval(function () { | ||
self.out._e(err); | ||
u._e(err); | ||
clearInterval(id); | ||
@@ -35,5 +39,7 @@ }, this.dt); | ||
DelayOperator.prototype._c = function () { | ||
var self = this; | ||
var u = this.out; | ||
if (!u) | ||
return; | ||
var id = setInterval(function () { | ||
self.out._c(); | ||
u._c(); | ||
clearInterval(id); | ||
@@ -40,0 +46,0 @@ }, this.dt); |
@@ -25,5 +25,8 @@ "use strict"; | ||
DropRepeatsOperator.prototype._n = function (t) { | ||
var u = this.out; | ||
if (!u) | ||
return; | ||
var v = this.v; | ||
if (v === empty || !this.isEq(t, v)) { | ||
this.out._n(t); | ||
u._n(t); | ||
} | ||
@@ -33,6 +36,12 @@ this.v = t; | ||
DropRepeatsOperator.prototype._e = function (err) { | ||
this.out._e(err); | ||
var u = this.out; | ||
if (!u) | ||
return; | ||
u._e(err); | ||
}; | ||
DropRepeatsOperator.prototype._c = function () { | ||
this.out._c(); | ||
var u = this.out; | ||
if (!u) | ||
return; | ||
u._c(); | ||
}; | ||
@@ -39,0 +48,0 @@ return DropRepeatsOperator; |
@@ -46,12 +46,21 @@ "use strict"; | ||
DropUntilOperator.prototype._n = function (t) { | ||
var u = this.out; | ||
if (!u) | ||
return; | ||
if (!this.on) | ||
return; | ||
this.out._n(t); | ||
u._n(t); | ||
}; | ||
DropUntilOperator.prototype._e = function (err) { | ||
this.out._e(err); | ||
var u = this.out; | ||
if (!u) | ||
return; | ||
u._e(err); | ||
}; | ||
DropUntilOperator.prototype._c = function () { | ||
var u = this.out; | ||
if (!u) | ||
return; | ||
this.up(); | ||
this.out._c(); | ||
u._c(); | ||
}; | ||
@@ -58,0 +67,0 @@ return DropUntilOperator; |
@@ -50,2 +50,5 @@ "use strict"; | ||
FlattenSeqOperator.prototype._n = function (s) { | ||
var u = this.out; | ||
if (!u) | ||
return; | ||
if (this.active) { | ||
@@ -56,12 +59,18 @@ this.seq.push(s); | ||
this.active = true; | ||
s._add(new FSInner(this.out, this)); | ||
s._add(new FSInner(u, this)); | ||
} | ||
}; | ||
FlattenSeqOperator.prototype._e = function (err) { | ||
this.out._e(err); | ||
var u = this.out; | ||
if (!u) | ||
return; | ||
u._e(err); | ||
}; | ||
FlattenSeqOperator.prototype._c = function () { | ||
var u = this.out; | ||
if (!u) | ||
return; | ||
this.open = false; | ||
if (this.seq.length === 0) { | ||
this.out._c(); | ||
u._c(); | ||
} | ||
@@ -68,0 +77,0 @@ }; |
@@ -22,4 +22,7 @@ "use strict"; | ||
PairwiseOperator.prototype._n = function (t) { | ||
var u = this.out; | ||
if (!u) | ||
return; | ||
if (this.has) { | ||
this.out._n([this.val, t]); | ||
u._n([this.val, t]); | ||
} | ||
@@ -30,6 +33,12 @@ this.val = t; | ||
PairwiseOperator.prototype._e = function (err) { | ||
this.out._e(err); | ||
var u = this.out; | ||
if (!u) | ||
return; | ||
u._e(err); | ||
}; | ||
PairwiseOperator.prototype._c = function () { | ||
this.out._c(); | ||
var u = this.out; | ||
if (!u) | ||
return; | ||
u._c(); | ||
}; | ||
@@ -36,0 +45,0 @@ return PairwiseOperator; |
@@ -48,10 +48,18 @@ "use strict"; | ||
SplitOperator.prototype._n = function (t) { | ||
if (!this.out) | ||
return; | ||
this.curr._n(t); | ||
}; | ||
SplitOperator.prototype._e = function (err) { | ||
this.out._e(err); | ||
var u = this.out; | ||
if (!u) | ||
return; | ||
u._e(err); | ||
}; | ||
SplitOperator.prototype._c = function () { | ||
var u = this.out; | ||
if (!u) | ||
return; | ||
this.curr._c(); | ||
this.out._c(); | ||
u._c(); | ||
}; | ||
@@ -58,0 +66,0 @@ return SplitOperator; |
{ | ||
"name": "xstream", | ||
"version": "2.4.2", | ||
"version": "2.4.3", | ||
"description": "An extremely intuitive, small, and fast functional reactive stream library for JavaScript", | ||
@@ -53,3 +53,3 @@ "main": "index.js", | ||
"ghooks": "^1.0.3", | ||
"markdown-doctest": "^0.3.3", | ||
"markdown-doctest": "^0.6.0", | ||
"markdox": "^0.1.10", | ||
@@ -56,0 +56,0 @@ "mkdirp": "^0.5.1", |
@@ -1001,2 +1001,16 @@ <!-- This README.md is automatically generated from source code and files in the /markdown directory. Please DO NOT send pull requests to directly modify this README. Instead, edit the JSDoc comments in source code or the md files in /markdown/. --> | ||
# CHANGELOG | ||
<a name="2.4.3"></a> | ||
## [2.4.3](https://github.com/staltz/xstream/compare/v2.4.2...v2.4.3) (2016-05-16) | ||
### Bug Fixes | ||
* **extra:** add safety check against nulls for next() etc ([cf82a8b](https://github.com/staltz/xstream/commit/cf82a8b)) | ||
### Performance Improvements | ||
* **debounce:** improve debounce speed/rate ([8bf7903](https://github.com/staltz/xstream/commit/8bf7903)) | ||
<a name="2.4.2"></a> | ||
@@ -1003,0 +1017,0 @@ ## [2.4.2](https://github.com/staltz/xstream/compare/v2.4.1...v2.4.2) (2016-05-13) |
@@ -26,10 +26,16 @@ import {Stream, InternalProducer, InternalListener} from '../core'; | ||
_n(t: T) { | ||
this.out._n(t); | ||
const u = this.out; | ||
if (!u) return; | ||
u._n(t); | ||
} | ||
_e(err: any) { | ||
this.out._e(err); | ||
const u = this.out; | ||
if (!u) return; | ||
u._e(err); | ||
} | ||
_c() { | ||
const u = this.out; | ||
if (!u) return; | ||
const streams = this.streams; | ||
@@ -40,3 +46,3 @@ streams[this.i]._remove(this); | ||
} else { | ||
this.out._c(); | ||
u._c(); | ||
} | ||
@@ -43,0 +49,0 @@ } |
@@ -25,6 +25,6 @@ import {Operator, Stream} from '../core'; | ||
clearTimer() { | ||
clearInterval() { | ||
const id = this.id; | ||
if (id !== null) { | ||
clearTimeout(id); | ||
clearInterval(id); | ||
} | ||
@@ -35,15 +35,24 @@ this.id = null; | ||
_n(t: T) { | ||
const u = this.out; | ||
if (!u) return; | ||
this.value = t; | ||
this.clearTimer(); | ||
this.id = setTimeout(() => this.out._n(this.value), this.dt); | ||
this.clearInterval(); | ||
this.id = setInterval(() => { | ||
this.clearInterval(); | ||
u._n(t); | ||
}, this.dt); | ||
} | ||
_e(err: any) { | ||
this.clearTimer(); | ||
this.out._e(err); | ||
const u = this.out; | ||
if (!u) return; | ||
this.clearInterval(); | ||
u._e(err); | ||
} | ||
_c() { | ||
this.clearTimer(); | ||
this.out._c(); | ||
const u = this.out; | ||
if (!u) return; | ||
this.clearInterval(); | ||
u._c(); | ||
} | ||
@@ -50,0 +59,0 @@ } |
@@ -22,5 +22,6 @@ import {Operator, Stream} from '../core'; | ||
_n(t: T) { | ||
const self = this; | ||
const u = this.out; | ||
if (!u) return; | ||
const id = setInterval(() => { | ||
self.out._n(t); | ||
u._n(t); | ||
clearInterval(id); | ||
@@ -31,5 +32,6 @@ }, this.dt); | ||
_e(err: any) { | ||
const self = this; | ||
const u = this.out; | ||
if (!u) return; | ||
const id = setInterval(() => { | ||
self.out._e(err); | ||
u._e(err); | ||
clearInterval(id); | ||
@@ -40,5 +42,6 @@ }, this.dt); | ||
_c() { | ||
const self = this; | ||
const u = this.out; | ||
if (!u) return; | ||
const id = setInterval(() => { | ||
self.out._c(); | ||
u._c(); | ||
clearInterval(id); | ||
@@ -45,0 +48,0 @@ }, this.dt); |
@@ -29,5 +29,7 @@ import {Operator, Stream} from '../core'; | ||
_n(t: T) { | ||
const u = this.out; | ||
if (!u) return; | ||
const v = this.v; | ||
if (v === empty || !this.isEq(t, v)) { | ||
this.out._n(t); | ||
u._n(t); | ||
} | ||
@@ -38,7 +40,11 @@ this.v = t; | ||
_e(err: any) { | ||
this.out._e(err); | ||
const u = this.out; | ||
if (!u) return; | ||
u._e(err); | ||
} | ||
_c() { | ||
this.out._c(); | ||
const u = this.out; | ||
if (!u) return; | ||
u._c(); | ||
} | ||
@@ -45,0 +51,0 @@ } |
@@ -51,13 +51,19 @@ import {Operator, InternalListener, Stream, emptyListener} from '../core'; | ||
_n(t: T) { | ||
const u = this.out; | ||
if (!u) return; | ||
if (!this.on) return; | ||
this.out._n(t); | ||
u._n(t); | ||
} | ||
_e(err: any) { | ||
this.out._e(err); | ||
const u = this.out; | ||
if (!u) return; | ||
u._e(err); | ||
} | ||
_c() { | ||
const u = this.out; | ||
if (!u) return; | ||
this.up(); | ||
this.out._c(); | ||
u._c(); | ||
} | ||
@@ -64,0 +70,0 @@ } |
@@ -56,2 +56,4 @@ import {Operator, Stream, InternalListener} from '../core'; | ||
_n(s: Stream<T>) { | ||
const u = this.out; | ||
if (!u) return; | ||
if (this.active) { | ||
@@ -61,3 +63,3 @@ this.seq.push(s); | ||
this.active = true; | ||
s._add(new FSInner(this.out, this)); | ||
s._add(new FSInner(u, this)); | ||
} | ||
@@ -67,9 +69,13 @@ } | ||
_e(err: any) { | ||
this.out._e(err); | ||
const u = this.out; | ||
if (!u) return; | ||
u._e(err); | ||
} | ||
_c() { | ||
const u = this.out; | ||
if (!u) return; | ||
this.open = false; | ||
if (this.seq.length === 0) { | ||
this.out._c(); | ||
u._c(); | ||
} | ||
@@ -76,0 +82,0 @@ } |
@@ -25,4 +25,6 @@ import {Operator, Stream} from '../core'; | ||
_n(t: T) { | ||
const u = this.out; | ||
if (!u) return; | ||
if (this.has) { | ||
this.out._n([this.val, t]); | ||
u._n([this.val, t]); | ||
} | ||
@@ -34,7 +36,11 @@ this.val = t; | ||
_e(err: any) { | ||
this.out._e(err); | ||
const u = this.out; | ||
if (!u) return; | ||
u._e(err); | ||
} | ||
_c() { | ||
this.out._c(); | ||
const u = this.out; | ||
if (!u) return; | ||
u._c(); | ||
} | ||
@@ -41,0 +47,0 @@ } |
@@ -53,2 +53,3 @@ import {Operator, InternalListener, Stream, emptyListener} from '../core'; | ||
_n(t: T) { | ||
if (!this.out) return; | ||
this.curr._n(t); | ||
@@ -58,8 +59,12 @@ } | ||
_e(err: any) { | ||
this.out._e(err); | ||
const u = this.out; | ||
if (!u) return; | ||
u._e(err); | ||
} | ||
_c() { | ||
const u = this.out; | ||
if (!u) return; | ||
this.curr._c(); | ||
this.out._c(); | ||
u._c(); | ||
} | ||
@@ -66,0 +71,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
796292
14455
1315