Socket
Socket
Sign inDemoInstall

kefir

Package Overview
Dependencies
Maintainers
1
Versions
86
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

kefir - npm Package Compare versions

Comparing version 0.1.8 to 0.1.9

bower_components/rxjs/.bower.json

12

bacon-api-impl-status.md

@@ -61,3 +61,3 @@ # Bacon.js API implementation status

| `observable.takeUntil(stream)` | :broken_heart: | |
| `observable.skip(n)` | :broken_heart: | |
| `observable.skip(n)` | :rocket: | `observable.skip(n)` |
| `observable.delay(delay)` | :broken_heart: | |

@@ -74,3 +74,3 @@ | `observable.throttle(delay)` | :broken_heart: | |

| `observable.fold(seed, f) / observable.reduce(seed, f)` | :broken_heart: | |
| `observable.diff(start, f)` | :broken_heart: | |
| `observable.diff(start, f)` | :rocket: | `observable.diff(start, f)` |
| `observable.zip(other, f)` | :broken_heart: | |

@@ -97,7 +97,7 @@ | `observable.slidingWindow(max [, min])` | :broken_heart: | |

| `stream.onValues(f)` | :broken_heart: | |
| `stream.skipDuplicates(isEqual)` | :broken_heart: | |
| `stream.skipDuplicates(isEqual)` | :rocket: | `stream.skipDuplicates(isEqual)` |
| `stream.concat(otherStream)` | :broken_heart: | |
| `stream.merge(otherStream)` | :rocket: | `stream.merge(stream1[, stream2, ...])` / `stream.merge(streams)` |
| `stream.startWith(value)` | :broken_heart: | |
| `stream.skipWhile(f)` | :broken_heart: | |
| `stream.skipWhile(f)` | :rocket: | `stream.skipWhile(f)` |
| `stream.skipWhile(property)` | :broken_heart: | |

@@ -127,3 +127,3 @@ | `stream.skipUntil(stream2)` | :broken_heart: | |

| `property.sampledBy(streamOrProperty, f)` | :broken_heart: | |
| `property.skipDuplicates(isEqual)` | :broken_heart: | |
| `property.skipDuplicates(isEqual)` | :rocket: | `property.skipDuplicates(isEqual)` |
| `property.changes()` | :rocket: | `property.changes()` |

@@ -142,3 +142,3 @@ | `property.and(other)` | :broken_heart: | |

| `Bacon.combineAsArray(s1, s2...)` | :broken_heart: | |
| `Bacon.combineWith(f, stream1, stream2...)` | :rocket: | `Kefir.combine(streams, f)` |
| `Bacon.combineWith(f, stream1, stream2...)` | :rocket: | `Kefir.combine(observables, f)` |
| `Bacon.combineTemplate(template)` | :broken_heart: | |

@@ -145,0 +145,0 @@ | `Bacon.mergeAll(streams)` | :rocket: | `Kefir.merge(streams)` / `Kefir.merge(stream1[, stream2, ...])` |

{
"name": "kefir",
"version": "0.1.8",
"version": "0.1.9",
"homepage": "https://github.com/pozadi/kefir",

@@ -47,4 +47,5 @@ "authors": [

"jquery": "~1.11.1",
"jasmine-reporters": "git@github.com:larrymyers/jasmine-reporters.git#~0.4.1"
"jasmine-reporters": "git@github.com:larrymyers/jasmine-reporters.git#~0.4.1",
"rxjs": "~2.2.24"
}
}

@@ -1,2 +0,2 @@

/*! kefir - 0.1.8
/*! kefir - 0.1.9
* https://github.com/pozadi/kefir

@@ -423,14 +423,2 @@ */

// TODO
//
// stream.skipWhile(f)
// observable.skip(n)
//
// observable.scan(seed, f)
// observable.diff(start, f)
//
// observable.skipDuplicates(isEqual)
var WithSourceStreamMixin = {

@@ -463,3 +451,3 @@ __Constructor: function(source) {

// observable.toProperty()
// observable.toProperty([initial])

@@ -512,3 +500,3 @@ Kefir.PropertyFromStream = function PropertyFromStream(source, initial){

// .scan()
// .scan(seed, fn)

@@ -542,3 +530,3 @@ Kefir.ScanProperty = function ScanProperty(source, seed, fn){

// Map
// .map(fn)

@@ -592,5 +580,18 @@ var MapMixin = {

// .diff(seed, fn)
// Filter
Observable.prototype.diff = function(prev, fn) {
return this.map(function(x){
var result = fn(prev, x);
prev = x;
return result;
})
}
// .filter(fn)
Observable.prototype.filter = function(fn) {

@@ -609,3 +610,3 @@ return this.map(function(x){

// TakeWhile
// .takeWhile(fn)

@@ -625,3 +626,3 @@ Observable.prototype.takeWhile = function(fn) {

// Take
// .take(n)

@@ -641,2 +642,57 @@ Observable.prototype.take = function(n) {

// .skip(n)
Observable.prototype.skip = function(n) {
return this.map(function(x){
if (n <= 0) {
return x;
} else {
n--;
return Kefir.NOTHING;
}
})
}
// .skipDuplicates([fn])
Observable.prototype.skipDuplicates = function(fn) {
var prev, hasPrev = false;
return this.map(function(x){
var result;
if (hasPrev && (fn ? fn(prev, x) : prev === x)) {
result = Kefir.NOTHING;
} else {
result = x;
}
hasPrev = true;
prev = x;
return result;
})
}
// .skipWhile(f)
Observable.prototype.skipWhile = function(fn) {
var skip = true;
return this.map(function(x){
if (skip && fn(x)) {
return Kefir.NOTHING;
} else {
skip = false;
return x;
}
})
}
// TODO

@@ -643,0 +699,0 @@ //

@@ -1,4 +0,4 @@

/*! kefir - 0.1.8
/*! kefir - 0.1.9
* https://github.com/pozadi/kefir
*/
!function(a){"use strict";function b(){}function c(a,b){return Object.prototype.hasOwnProperty.call(a,b)}function d(a){return a instanceof Array?a:Array.prototype.slice.call(a)}function e(a){var b=function(){};return b.prototype=a,new b}function f(){var a=d(arguments);if(1===a.length)return a[0];for(var b=a.shift(),e=0;e<a.length;e++)for(var f in a[e])c(a[e],f)&&(b[f]=a[e][f]);return b}function g(a,b){a.prototype=e(b.prototype),a.prototype.constructor=a;for(var c=2;c<arguments.length;c++)f(a.prototype,arguments[c]);return a}function h(a,b){for(var d in b)!c(b,d)||d in a||(a[d]=b[d]);return a}function i(a){return"[object Array]"===Object.prototype.toString.call(a[0])?a[0]:d(a)}function j(a,b,c){return a.length>b?Array.prototype.slice.call(a,b):c?null:[]}function k(a,b){var c=a[1],e=a[2],f=j(a,3);return b&&(f=f.concat(d(b))),c.apply(e,f)}function l(a){return"function"==typeof a}function m(a,b){if(null==a&&null==b)return!0;if(null==a||null==b)return!1;if(a.length!==b.length)return!1;for(var c=0;c<a.length;c++)if(a[c]!==b[c])return!1;return!0}var n={},o=n.NOTHING=["<nothing>"],p=n.END=["<end>"],q=n.NO_MORE=["<no more>"];n.BunchOfValues=function(a){this.values=a},n.bunch=function(){return new n.BunchOfValues(i(arguments))};var r=n.Observable=function(a,b){l(a)&&(this.__onFirstIn=a),l(b)&&(this.__onLastOut=b),this.__subscribers=[]};g(r,Object,{__ClassName:"Observable",toString:function(){return"["+this.__ClassName+(this.__objName?" | "+this.__objName:"")+"]"},__onFirstIn:b,__onLastOut:b,__on:function(a){if(this.isEnded())"end"===a&&k(arguments);else{var b="value"===a&&!this.__hasSubscribers("value");this.__subscribers.push(arguments),b&&this.__onFirstIn()}},__off:function(a){if(!this.isEnded()){for(var b=0;b<this.__subscribers.length;b++)m(this.__subscribers[b],arguments)&&(this.__subscribers[b]=null);"value"!==a||this.__hasSubscribers("value")||this.__onLastOut()}},__send:function(a){if(!this.isEnded()){for(var b=0;b<this.__subscribers.length;b++){var c=this.__subscribers[b];if(c&&c[0]===a){var d=k(c,j(arguments,1));d===q&&this.__off.apply(this,c)}}"end"===a&&this.__clear()}},__hasSubscribers:function(a){if(this.isEnded())return!1;for(var b=0;b<this.__subscribers.length;b++)if(this.__subscribers[b]&&this.__subscribers[b][0]===a)return!0;return!1},__clear:function(){this.__onLastOut(),c(this,"__onFirstIn")&&(this.__onFirstIn=null),c(this,"__onLastOut")&&(this.__onLastOut=null),this.__subscribers=null},__sendValue:function(a){this.__send("value",a)},__sendEnd:function(){this.__send("end")},__sendAny:function(a){if(a===p)this.__sendEnd();else if(a instanceof n.BunchOfValues)for(var b=0;b<a.values.length;b++)this.__sendAny(a.values[b]);else a!==n.NOTHING&&this.__sendValue(a)},onValue:function(){this.__on.apply(this,["value"].concat(d(arguments)))},offValue:function(){this.__off.apply(this,["value"].concat(d(arguments)))},onEnd:function(){this.__on.apply(this,["end"].concat(d(arguments)))},offEnd:function(){this.__off.apply(this,["end"].concat(d(arguments)))},onNewValue:function(){this.onValue.apply(this,arguments)},isEnded:function(){return!this.__subscribers}});var s=n.Stream=function(){r.apply(this,arguments)};g(s,r,{__ClassName:"Stream"});var t=n.Property=function(a,b,c){r.call(this,a,b),this.__cached="undefined"!=typeof c?c:n.NOTHING};g(t,r,{__ClassName:"Property",hasCached:function(){return this.__cached!==n.NOTHING},getCached:function(){return this.__cached},__sendValue:function(a){this.isEnded()||(this.__cached=a),r.prototype.__sendValue.call(this,a)},onNewValue:function(){this.__on.apply(this,["value"].concat(d(arguments)))},onValue:function(){this.hasCached()&&k(["value"].concat(d(arguments)),[this.__cached]),this.onNewValue.apply(this,arguments)}}),r.prototype.log=function(a){function b(b){console.log(a,b)}a||(a=this.toString()),this.onValue(b),this.onEnd(function(){b(p)})};var u=new s;u.__sendEnd(),u.__objName="Kefir.never()",n.never=function(){return u},n.OnceStream=function(a){s.call(this),this.__value=a},g(n.OnceStream,s,{__ClassName:"OnceStream",onValue:function(){this.isEnded()||(k(["value"].concat(d(arguments)),[this.__value]),this.__value=null,this.__sendEnd())}}),n.once=function(a){return new n.OnceStream(a)},n.FromBinderStream=function(a){s.call(this),this.__subscribe=a},g(n.FromBinderStream,s,{__ClassName:"FromBinderStream",__onFirstIn:function(){var a=this;this.__usubscriber=this.__subscribe(function(b){a.__sendAny(b)})},__onLastOut:function(){l(this.__usubscriber)&&this.__usubscriber(),this.__usubscriber=null},__clear:function(){s.prototype.__clear.call(this),this.__subscribe=null}}),n.fromBinder=function(a){return new n.FromBinderStream(a)};var v={__Constructor:function(a){this.__source=a,a.onEnd(this.__sendEnd,this),a instanceof t&&this instanceof t&&a.hasCached()&&this.__handle(a.getCached())},__handle:function(a){this.__sendAny(a)},__onFirstIn:function(){this.__source.onNewValue(this.__handle,this)},__onLastOut:function(){this.__source.offValue(this.__handle,this)},__clear:function(){r.prototype.__clear.call(this),this.__source=null}};n.PropertyFromStream=function(a,b){t.call(this,null,null,b),this.__Constructor(a)},g(n.PropertyFromStream,t,v,{__ClassName:"PropertyFromStream"}),s.prototype.toProperty=function(a){return new n.PropertyFromStream(this,a)},t.prototype.toProperty=function(a){if("undefined"==typeof a)return this;var b=new n.PropertyFromStream(this);return b.__sendValue(a),b},n.ChangesStream=function(a){s.call(this),this.__Constructor(a)},g(n.ChangesStream,s,v,{__ClassName:"ChangesStream"}),t.prototype.changes=function(){return new n.ChangesStream(this)},n.ScanProperty=function(a,b,c){t.call(this,null,null,b),this.__fn=c,this.__Constructor(a)},g(n.ScanProperty,t,v,{__ClassName:"ScanProperty",__handle:function(a){this.__sendValue(this.__fn(this.getCached(),a))},__clear:function(){v.__clear.call(this),this.__fn=null}}),r.prototype.scan=function(a,b){return new n.ScanProperty(this,a,b)};var w={__Constructor:function(a,b){a instanceof t?t.call(this):s.call(this),this.__mapFn=b,v.__Constructor.call(this,a)},__handle:function(a){this.__sendAny(this.__mapFn(a))},__clear:function(){v.__clear.call(this),this.__mapFn=null}};h(w,v),n.MappedStream=function(){this.__Constructor.apply(this,arguments)},g(n.MappedStream,s,w,{__ClassName:"MappedStream"}),n.MappedProperty=function(){this.__Constructor.apply(this,arguments)},g(n.MappedProperty,t,w,{__ClassName:"MappedProperty"}),s.prototype.map=function(a){return new n.MappedStream(this,a)},t.prototype.map=function(a){return new n.MappedProperty(this,a)},r.prototype.filter=function(a){return this.map(function(b){return a(b)?b:o})},r.prototype.takeWhile=function(a){return this.map(function(b){return a(b)?b:p})},r.prototype.take=function(a){return this.map(function(b){return 0>=a?p:1===a?n.bunch(b,p):(a--,b)})};var x={__initPluggable:function(){this.__plugged=[]},__clearPluggable:function(){this.__plugged=null},__handlePlugged:function(a,b){this.__sendAny(b)},__plug:function(a){if(!this.isEnded()){this.__plugged.push(a);var b=this.__plugged.length-1;this.__hasSubscribers("value")&&a.onValue(this.__handlePlugged,this,b),a.onEnd(this.__unplugById,this,b)}},__unplugById:function(a){if(!this.isEnded()){var b=this.__plugged[a];b&&(this.__plugged[a]=null,b.offValue(this.__handlePlugged,this,a),b.onEnd(this.__unplugById,this,a))}},__unplug:function(a){if(!this.isEnded())for(var b=0;b<this.__plugged.length;b++)this.__plugged[b]===a&&this.__unplugById(b)},__onFirstIn:function(){for(var a=0;a<this.__plugged.length;a++){var b=this.__plugged[a];b&&b.onValue(this.__handlePlugged,this,a)}},__onLastOut:function(){for(var a=0;a<this.__plugged.length;a++){var b=this.__plugged[a];b&&b.offValue(this.__handlePlugged,this,a)}},__hasNoPlugged:function(){if(this.isEnded())return!0;for(var a=0;a<this.__plugged.length;a++)if(this.__plugged[a])return!1;return!0}};n.Bus=function(){s.call(this),this.__initPluggable()},g(n.Bus,s,x,{__ClassName:"Bus",push:function(a){this.__sendAny(a)},plug:function(a){this.__plug(a)},unplug:function(a){this.__unplug(a)},end:function(){this.__sendEnd()},__clear:function(){s.prototype.__clear.call(this),this.__clearPluggable(),this.push=b}}),n.bus=function(){return new n.Bus},n.FlatMappedStream=function(a,b){s.call(this),this.__initPluggable(),this.__sourceStream=a,this.__mapFn=b,a.onEnd(this.__onSourceEnds,this)},g(n.FlatMappedStream,s,x,{__ClassName:"FlatMappedStream",__onSourceEnds:function(){this.__hasNoPlugged()&&this.__sendEnd()},__plugResult:function(a){this.__plug(this.__mapFn(a))},__onFirstIn:function(){this.__sourceStream.onValue(this.__plugResult,this),x.__onFirstIn.call(this)},__onLastOut:function(){this.__sourceStream.offValue(this.__plugResult,this),x.__onLastOut.call(this)},__unplugById:function(a){x.__unplugById.call(this,a),!this.isEnded()&&this.__hasNoPlugged()&&this.__sourceStream.isEnded()&&this.__sendEnd()},__clear:function(){s.prototype.__clear.call(this),this.__clearPluggable(),this.__sourceStream=null,this.__mapFn=null}}),r.prototype.flatMap=function(a){return new n.FlatMappedStream(this,a)},n.MergedStream=function(){s.call(this),this.__initPluggable();for(var a=i(arguments),b=0;b<a.length;b++)this.__plug(a[b])},g(n.MergedStream,s,x,{__ClassName:"MergedStream",__clear:function(){s.prototype.__clear.call(this),this.__clearPluggable()},__unplugById:function(a){x.__unplugById.call(this,a),this.__hasNoPlugged()&&this.__sendEnd()}}),n.merge=function(){return new n.MergedStream(i(arguments))},r.prototype.merge=function(){return n.merge([this].concat(i(arguments)))},n.CombinedStream=function(a,b){s.call(this),this.__initPluggable();for(var c=0;c<a.length;c++)this.__plug(a[c]);this.__cachedValues=new Array(a.length),this.__hasCached=new Array(a.length),this.__mapFn=b},g(n.CombinedStream,s,x,{__ClassName:"CombinedStream",__unplugById:function(a){x.__unplugById.call(this,a),this.__hasNoPlugged()&&this.__sendEnd()},__handlePlugged:function(a,b){this.__hasCached[a]=!0,this.__cachedValues[a]=b,this.__allCached()&&(l(this.__mapFn)?this.__sendAny(this.__mapFn.apply(null,this.__cachedValues)):this.__sendValue(this.__cachedValues.slice(0)))},__allCached:function(){for(var a=0;a<this.__hasCached.length;a++)if(!this.__hasCached[a])return!1;return!0},__clear:function(){s.prototype.__clear.call(this),this.__clearPluggable(),this.__cachedValues=null,this.__hasCached=null,this.__mapFn=null}}),n.combine=function(a,b){return new n.CombinedStream(a,b)},r.prototype.combine=function(a,b){return n.combine([this].concat(a),b)};var y=n.FromPollStream=function(a,b){s.call(this),this.__interval=a,this.__intervalId=null;var c=this;this.__bindedSend=function(){c.__sendAny(b())}};g(y,s,{__ClassName:"FromPollStream",__onFirstIn:function(){this.__intervalId=setInterval(this.__bindedSend,this.__interval)},__onLastOut:function(){null!==this.__intervalId&&(clearInterval(this.__intervalId),this.__intervalId=null)},__clear:function(){s.prototype.__clear.call(this),this.__bindedSend=null}}),n.fromPoll=function(a,b){return new y(a,b)},n.interval=function(a,b){return new y(a,function(){return b})},n.sequentially=function(a,b){return b=b.slice(0),new y(a,function(){return 0===b.length?p:1===b.length?n.bunch(b[0],p):b.shift()})},n.repeatedly=function(a,b){var c=-1;return new y(a,function(){return b[++c%b.length]})},"function"==typeof define&&define.amd?(define([],function(){return n}),a.Kefir=n):"object"==typeof module&&"object"==typeof exports?(module.exports=n,n.Kefir=n):a.Kefir=n}(this);
!function(a){"use strict";function b(){}function c(a,b){return Object.prototype.hasOwnProperty.call(a,b)}function d(a){return a instanceof Array?a:Array.prototype.slice.call(a)}function e(a){var b=function(){};return b.prototype=a,new b}function f(){var a=d(arguments);if(1===a.length)return a[0];for(var b=a.shift(),e=0;e<a.length;e++)for(var f in a[e])c(a[e],f)&&(b[f]=a[e][f]);return b}function g(a,b){a.prototype=e(b.prototype),a.prototype.constructor=a;for(var c=2;c<arguments.length;c++)f(a.prototype,arguments[c]);return a}function h(a,b){for(var d in b)!c(b,d)||d in a||(a[d]=b[d]);return a}function i(a){return"[object Array]"===Object.prototype.toString.call(a[0])?a[0]:d(a)}function j(a,b,c){return a.length>b?Array.prototype.slice.call(a,b):c?null:[]}function k(a,b){var c=a[1],e=a[2],f=j(a,3);return b&&(f=f.concat(d(b))),c.apply(e,f)}function l(a){return"function"==typeof a}function m(a,b){if(null==a&&null==b)return!0;if(null==a||null==b)return!1;if(a.length!==b.length)return!1;for(var c=0;c<a.length;c++)if(a[c]!==b[c])return!1;return!0}var n={},o=n.NOTHING=["<nothing>"],p=n.END=["<end>"],q=n.NO_MORE=["<no more>"];n.BunchOfValues=function(a){this.values=a},n.bunch=function(){return new n.BunchOfValues(i(arguments))};var r=n.Observable=function(a,b){l(a)&&(this.__onFirstIn=a),l(b)&&(this.__onLastOut=b),this.__subscribers=[]};g(r,Object,{__ClassName:"Observable",toString:function(){return"["+this.__ClassName+(this.__objName?" | "+this.__objName:"")+"]"},__onFirstIn:b,__onLastOut:b,__on:function(a){if(this.isEnded())"end"===a&&k(arguments);else{var b="value"===a&&!this.__hasSubscribers("value");this.__subscribers.push(arguments),b&&this.__onFirstIn()}},__off:function(a){if(!this.isEnded()){for(var b=0;b<this.__subscribers.length;b++)m(this.__subscribers[b],arguments)&&(this.__subscribers[b]=null);"value"!==a||this.__hasSubscribers("value")||this.__onLastOut()}},__send:function(a){if(!this.isEnded()){for(var b=0;b<this.__subscribers.length;b++){var c=this.__subscribers[b];if(c&&c[0]===a){var d=k(c,j(arguments,1));d===q&&this.__off.apply(this,c)}}"end"===a&&this.__clear()}},__hasSubscribers:function(a){if(this.isEnded())return!1;for(var b=0;b<this.__subscribers.length;b++)if(this.__subscribers[b]&&this.__subscribers[b][0]===a)return!0;return!1},__clear:function(){this.__onLastOut(),c(this,"__onFirstIn")&&(this.__onFirstIn=null),c(this,"__onLastOut")&&(this.__onLastOut=null),this.__subscribers=null},__sendValue:function(a){this.__send("value",a)},__sendEnd:function(){this.__send("end")},__sendAny:function(a){if(a===p)this.__sendEnd();else if(a instanceof n.BunchOfValues)for(var b=0;b<a.values.length;b++)this.__sendAny(a.values[b]);else a!==n.NOTHING&&this.__sendValue(a)},onValue:function(){this.__on.apply(this,["value"].concat(d(arguments)))},offValue:function(){this.__off.apply(this,["value"].concat(d(arguments)))},onEnd:function(){this.__on.apply(this,["end"].concat(d(arguments)))},offEnd:function(){this.__off.apply(this,["end"].concat(d(arguments)))},onNewValue:function(){this.onValue.apply(this,arguments)},isEnded:function(){return!this.__subscribers}});var s=n.Stream=function(){r.apply(this,arguments)};g(s,r,{__ClassName:"Stream"});var t=n.Property=function(a,b,c){r.call(this,a,b),this.__cached="undefined"!=typeof c?c:n.NOTHING};g(t,r,{__ClassName:"Property",hasCached:function(){return this.__cached!==n.NOTHING},getCached:function(){return this.__cached},__sendValue:function(a){this.isEnded()||(this.__cached=a),r.prototype.__sendValue.call(this,a)},onNewValue:function(){this.__on.apply(this,["value"].concat(d(arguments)))},onValue:function(){this.hasCached()&&k(["value"].concat(d(arguments)),[this.__cached]),this.onNewValue.apply(this,arguments)}}),r.prototype.log=function(a){function b(b){console.log(a,b)}a||(a=this.toString()),this.onValue(b),this.onEnd(function(){b(p)})};var u=new s;u.__sendEnd(),u.__objName="Kefir.never()",n.never=function(){return u},n.OnceStream=function(a){s.call(this),this.__value=a},g(n.OnceStream,s,{__ClassName:"OnceStream",onValue:function(){this.isEnded()||(k(["value"].concat(d(arguments)),[this.__value]),this.__value=null,this.__sendEnd())}}),n.once=function(a){return new n.OnceStream(a)},n.FromBinderStream=function(a){s.call(this),this.__subscribe=a},g(n.FromBinderStream,s,{__ClassName:"FromBinderStream",__onFirstIn:function(){var a=this;this.__usubscriber=this.__subscribe(function(b){a.__sendAny(b)})},__onLastOut:function(){l(this.__usubscriber)&&this.__usubscriber(),this.__usubscriber=null},__clear:function(){s.prototype.__clear.call(this),this.__subscribe=null}}),n.fromBinder=function(a){return new n.FromBinderStream(a)};var v={__Constructor:function(a){this.__source=a,a.onEnd(this.__sendEnd,this),a instanceof t&&this instanceof t&&a.hasCached()&&this.__handle(a.getCached())},__handle:function(a){this.__sendAny(a)},__onFirstIn:function(){this.__source.onNewValue(this.__handle,this)},__onLastOut:function(){this.__source.offValue(this.__handle,this)},__clear:function(){r.prototype.__clear.call(this),this.__source=null}};n.PropertyFromStream=function(a,b){t.call(this,null,null,b),this.__Constructor(a)},g(n.PropertyFromStream,t,v,{__ClassName:"PropertyFromStream"}),s.prototype.toProperty=function(a){return new n.PropertyFromStream(this,a)},t.prototype.toProperty=function(a){if("undefined"==typeof a)return this;var b=new n.PropertyFromStream(this);return b.__sendValue(a),b},n.ChangesStream=function(a){s.call(this),this.__Constructor(a)},g(n.ChangesStream,s,v,{__ClassName:"ChangesStream"}),t.prototype.changes=function(){return new n.ChangesStream(this)},n.ScanProperty=function(a,b,c){t.call(this,null,null,b),this.__fn=c,this.__Constructor(a)},g(n.ScanProperty,t,v,{__ClassName:"ScanProperty",__handle:function(a){this.__sendValue(this.__fn(this.getCached(),a))},__clear:function(){v.__clear.call(this),this.__fn=null}}),r.prototype.scan=function(a,b){return new n.ScanProperty(this,a,b)};var w={__Constructor:function(a,b){a instanceof t?t.call(this):s.call(this),this.__mapFn=b,v.__Constructor.call(this,a)},__handle:function(a){this.__sendAny(this.__mapFn(a))},__clear:function(){v.__clear.call(this),this.__mapFn=null}};h(w,v),n.MappedStream=function(){this.__Constructor.apply(this,arguments)},g(n.MappedStream,s,w,{__ClassName:"MappedStream"}),n.MappedProperty=function(){this.__Constructor.apply(this,arguments)},g(n.MappedProperty,t,w,{__ClassName:"MappedProperty"}),s.prototype.map=function(a){return new n.MappedStream(this,a)},t.prototype.map=function(a){return new n.MappedProperty(this,a)},r.prototype.diff=function(a,b){return this.map(function(c){var d=b(a,c);return a=c,d})},r.prototype.filter=function(a){return this.map(function(b){return a(b)?b:o})},r.prototype.takeWhile=function(a){return this.map(function(b){return a(b)?b:p})},r.prototype.take=function(a){return this.map(function(b){return 0>=a?p:1===a?n.bunch(b,p):(a--,b)})},r.prototype.skip=function(a){return this.map(function(b){return 0>=a?b:(a--,n.NOTHING)})},r.prototype.skipDuplicates=function(a){var b,c=!1;return this.map(function(d){var e;return e=c&&(a?a(b,d):b===d)?n.NOTHING:d,c=!0,b=d,e})},r.prototype.skipWhile=function(a){var b=!0;return this.map(function(c){return b&&a(c)?n.NOTHING:(b=!1,c)})};var x={__initPluggable:function(){this.__plugged=[]},__clearPluggable:function(){this.__plugged=null},__handlePlugged:function(a,b){this.__sendAny(b)},__plug:function(a){if(!this.isEnded()){this.__plugged.push(a);var b=this.__plugged.length-1;this.__hasSubscribers("value")&&a.onValue(this.__handlePlugged,this,b),a.onEnd(this.__unplugById,this,b)}},__unplugById:function(a){if(!this.isEnded()){var b=this.__plugged[a];b&&(this.__plugged[a]=null,b.offValue(this.__handlePlugged,this,a),b.onEnd(this.__unplugById,this,a))}},__unplug:function(a){if(!this.isEnded())for(var b=0;b<this.__plugged.length;b++)this.__plugged[b]===a&&this.__unplugById(b)},__onFirstIn:function(){for(var a=0;a<this.__plugged.length;a++){var b=this.__plugged[a];b&&b.onValue(this.__handlePlugged,this,a)}},__onLastOut:function(){for(var a=0;a<this.__plugged.length;a++){var b=this.__plugged[a];b&&b.offValue(this.__handlePlugged,this,a)}},__hasNoPlugged:function(){if(this.isEnded())return!0;for(var a=0;a<this.__plugged.length;a++)if(this.__plugged[a])return!1;return!0}};n.Bus=function(){s.call(this),this.__initPluggable()},g(n.Bus,s,x,{__ClassName:"Bus",push:function(a){this.__sendAny(a)},plug:function(a){this.__plug(a)},unplug:function(a){this.__unplug(a)},end:function(){this.__sendEnd()},__clear:function(){s.prototype.__clear.call(this),this.__clearPluggable(),this.push=b}}),n.bus=function(){return new n.Bus},n.FlatMappedStream=function(a,b){s.call(this),this.__initPluggable(),this.__sourceStream=a,this.__mapFn=b,a.onEnd(this.__onSourceEnds,this)},g(n.FlatMappedStream,s,x,{__ClassName:"FlatMappedStream",__onSourceEnds:function(){this.__hasNoPlugged()&&this.__sendEnd()},__plugResult:function(a){this.__plug(this.__mapFn(a))},__onFirstIn:function(){this.__sourceStream.onValue(this.__plugResult,this),x.__onFirstIn.call(this)},__onLastOut:function(){this.__sourceStream.offValue(this.__plugResult,this),x.__onLastOut.call(this)},__unplugById:function(a){x.__unplugById.call(this,a),!this.isEnded()&&this.__hasNoPlugged()&&this.__sourceStream.isEnded()&&this.__sendEnd()},__clear:function(){s.prototype.__clear.call(this),this.__clearPluggable(),this.__sourceStream=null,this.__mapFn=null}}),r.prototype.flatMap=function(a){return new n.FlatMappedStream(this,a)},n.MergedStream=function(){s.call(this),this.__initPluggable();for(var a=i(arguments),b=0;b<a.length;b++)this.__plug(a[b])},g(n.MergedStream,s,x,{__ClassName:"MergedStream",__clear:function(){s.prototype.__clear.call(this),this.__clearPluggable()},__unplugById:function(a){x.__unplugById.call(this,a),this.__hasNoPlugged()&&this.__sendEnd()}}),n.merge=function(){return new n.MergedStream(i(arguments))},r.prototype.merge=function(){return n.merge([this].concat(i(arguments)))},n.CombinedStream=function(a,b){s.call(this),this.__initPluggable();for(var c=0;c<a.length;c++)this.__plug(a[c]);this.__cachedValues=new Array(a.length),this.__hasCached=new Array(a.length),this.__mapFn=b},g(n.CombinedStream,s,x,{__ClassName:"CombinedStream",__unplugById:function(a){x.__unplugById.call(this,a),this.__hasNoPlugged()&&this.__sendEnd()},__handlePlugged:function(a,b){this.__hasCached[a]=!0,this.__cachedValues[a]=b,this.__allCached()&&(l(this.__mapFn)?this.__sendAny(this.__mapFn.apply(null,this.__cachedValues)):this.__sendValue(this.__cachedValues.slice(0)))},__allCached:function(){for(var a=0;a<this.__hasCached.length;a++)if(!this.__hasCached[a])return!1;return!0},__clear:function(){s.prototype.__clear.call(this),this.__clearPluggable(),this.__cachedValues=null,this.__hasCached=null,this.__mapFn=null}}),n.combine=function(a,b){return new n.CombinedStream(a,b)},r.prototype.combine=function(a,b){return n.combine([this].concat(a),b)};var y=n.FromPollStream=function(a,b){s.call(this),this.__interval=a,this.__intervalId=null;var c=this;this.__bindedSend=function(){c.__sendAny(b())}};g(y,s,{__ClassName:"FromPollStream",__onFirstIn:function(){this.__intervalId=setInterval(this.__bindedSend,this.__interval)},__onLastOut:function(){null!==this.__intervalId&&(clearInterval(this.__intervalId),this.__intervalId=null)},__clear:function(){s.prototype.__clear.call(this),this.__bindedSend=null}}),n.fromPoll=function(a,b){return new y(a,b)},n.interval=function(a,b){return new y(a,function(){return b})},n.sequentially=function(a,b){return b=b.slice(0),new y(a,function(){return 0===b.length?p:1===b.length?n.bunch(b[0],p):b.shift()})},n.repeatedly=function(a,b){var c=-1;return new y(a,function(){return b[++c%b.length]})},"function"==typeof define&&define.amd?(define([],function(){return n}),a.Kefir=n):"object"==typeof module&&"object"==typeof exports?(module.exports=n,n.Kefir=n):a.Kefir=n}(this);

@@ -0,67 +1,74 @@

Generated by run: node --expose-gc test-memory-usage.js > memory-usage-results.txt
Please don't take this results too serious, I am not 100% sure about correctness of this tests
new Stream(noop, noop) x1000
Kefir: w/o subscr. 0.08 Mb, w. subscr. 0.29 Mb
new Bus() x1000
Kefir: w/o subscr. 0.11 Mb, w. subscr. 0.31 Mb
Bacon: w/o subscr. 3.56 Mb, w. subscr. 4.19 Mb
very base stream
Kefir: w/o subscr. 0.68 Kb, w/ subscr. +0.22 Kb
Rx: w/o subscr. 0.25 Kb, w/ subscr. +0.43 Kb
Bacon: w/o subscr. 3.04 Kb, w/ subscr. +0.92 Kb
.fromBinder(noop) x1000
Kefir: w/o subscr. 0.07 Mb, w. subscr. 0.31 Mb
Bacon: w/o subscr. 2.77 Mb, w. subscr. 3.51 Mb
new Bus()
Kefir: w/o subscr. 0.10 Kb, w/ subscr. +0.22 Kb
Bacon: w/o subscr. 3.72 Kb, w/ subscr. +0.76 Kb
new Bus().toProperty(1) x1000
Kefir: w/o subscr. 0.41 Mb, w. subscr. 0.69 Mb
Bacon: w/o subscr. 8.12 Mb, w. subscr. 9.84 Mb
.once(1)
Kefir: w/o subscr. 0.07 Kb, w/ subscr. +0.04 Kb
Bacon: w/o subscr. 4.09 Kb, w/ subscr. +0.95 Kb
new Bus().toProperty(1).changes() x1000
Kefir: w/o subscr. 0.68 Mb, w. subscr. 1.02 Mb
Bacon: w/o subscr. 10.87 Mb, w. subscr. 13.12 Mb
.never()
Kefir: w/o subscr. -0.00 Kb, w/ subscr. -0.01 Kb
Rx: w/o subscr. 0.23 Kb, w/ subscr. +0.00 Kb
Bacon: w/o subscr. 4.04 Kb, w/ subscr. +0.89 Kb
new Bus().map(noop) x1000
Kefir: w/o subscr. 0.40 Mb, w. subscr. 0.66 Mb
Bacon: w/o subscr. 8.57 Mb, w. subscr. 10.10 Mb
.toProperty(1)
Kefir: w/o subscr. 0.97 Kb, w/ subscr. +0.29 Kb
Rx: w/o subscr. 1.22 Kb, w/ subscr. +1.18 Kb
Bacon: w/o subscr. 7.88 Kb, w/ subscr. +1.92 Kb
new Bus().scan(0, noop) x1000
Kefir: w/o subscr. 0.39 Mb, w. subscr. 0.67 Mb
Bacon: w/o subscr. 7.09 Mb, w. subscr. 8.82 Mb
.toProperty(1).changes()
Kefir: w/o subscr. 1.25 Kb, w/ subscr. +0.38 Kb
Bacon: w/o subscr. 10.80 Kb, w/ subscr. +2.44 Kb
.sequentially(0, [1, 2])
Kefir: w/o subscr. 0.41 Mb, w. subscr. 0.92 Mb
Bacon: w/o subscr. 4.71 Mb, w. subscr. 6.02 Mb
.map(noop)
Kefir: w/o subscr. 0.96 Kb, w/ subscr. +0.28 Kb
Rx: w/o subscr. 0.52 Kb, w/ subscr. +1.52 Kb
Bacon: w/o subscr. 8.29 Kb, w/ subscr. +1.71 Kb
new Bus().filter(noop) x1000
Kefir: w/o subscr. 0.55 Mb, w. subscr. 0.82 Mb
Bacon: w/o subscr. 8.55 Mb, w. subscr. 10.07 Mb
.filter(noop)
Kefir: w/o subscr. 1.11 Kb, w/ subscr. +0.28 Kb
Rx: w/o subscr. 0.52 Kb, w/ subscr. +1.47 Kb
Bacon: w/o subscr. 8.27 Kb, w/ subscr. +1.71 Kb
new Kefir.Bus().take(5) x1000
Kefir: w/o subscr. 0.55 Mb, w. subscr. 0.82 Mb
Bacon: w/o subscr. 8.48 Mb, w. subscr. 10.01 Mb
.scan(0, noop)
Kefir: w/o subscr. 0.96 Kb, w/ subscr. +0.34 Kb
Rx: w/o subscr. 0.54 Kb, w/ subscr. +1.17 Kb
Bacon: w/o subscr. 6.80 Kb, w/ subscr. +1.90 Kb
new Bus().flatMap(noop) x1000
Kefir: w/o subscr. 0.43 Mb, w. subscr. 0.70 Mb
Bacon: w/o subscr. 6.20 Mb, w. subscr. 8.46 Mb
.sequentially(0, [1, 2])
Kefir: w/o subscr. 0.41 Kb, w/ subscr. +0.55 Kb
Bacon: w/o subscr. 5.02 Kb, w/ subscr. +1.32 Kb
.fromBinder(noop).combine(Kefir.fromBinder(noop), noop) x500
Kefir: w/o subscr. 0.51 Mb, w. subscr. 0.69 Mb
Bacon: w/o subscr. 9.74 Mb, w. subscr. 12.01 Mb
.take(5)
Kefir: w/o subscr. 1.11 Kb, w/ subscr. +0.28 Kb
Rx: w/o subscr. 0.52 Kb, w/ subscr. +1.47 Kb
Bacon: w/o subscr. 8.20 Kb, w/ subscr. +1.71 Kb
.once(1) x1000
Kefir: w/o subscr. 0.07 Mb, w. subscr. 0.05 Mb
Bacon: w/o subscr. 3.86 Mb, w. subscr. 4.63 Mb
.flatMap(noop)
Kefir: w/o subscr. 0.99 Kb, w/ subscr. +0.29 Kb
Rx: w/o subscr. 0.94 Kb, w/ subscr. +2.59 Kb
Bacon: w/o subscr. 5.91 Kb, w/ subscr. +2.71 Kb
.never() x1000
Kefir: w/o subscr. 0.00 Mb, w. subscr. 0.00 Mb
Bacon: w/o subscr. 3.81 Mb, w. subscr. 4.72 Mb
.combine(stream, noop)
Kefir: w/o subscr. 2.19 Kb, w/ subscr. +0.37 Kb
Rx: w/o subscr. 0.82 Kb, w/ subscr. +2.93 Kb
Bacon: w/o subscr. 20.98 Kb, w/ subscr. +5.01 Kb
.combineAsArray(bus, bus, bus, bus) x300
Kefir: w/o subscr. 0.53 Mb, w. subscr. 0.68 Mb
Bacon: w/o subscr. 6.94 Mb, w. subscr. 8.72 Mb
.combineAsArray(stream1, stream2, stream3, stream4)
Kefir: w/o subscr. 3.97 Kb, w/ subscr. +0.51 Kb
Rx: w/o subscr. 1.27 Kb, w/ subscr. +3.88 Kb
Bacon: w/o subscr. 21.46 Kb, w/ subscr. +6.71 Kb
.mergeAll(bus, bus, bus, bus) x300
Kefir: w/o subscr. 0.47 Mb, w. subscr. 0.61 Mb
Bacon: w/o subscr. 8.89 Mb, w. subscr. 11.50 Mb
crazy x100
Kefir: w/o subscr. 0.61 Mb, w. subscr. 0.77 Mb
Bacon: w/o subscr. 7.96 Mb, w. subscr. 10.13 Mb
.mergeAll(stream1, stream2, stream3, stream4)
Kefir: w/o subscr. 3.75 Kb, w/ subscr. +0.51 Kb
Rx: w/o subscr. 1.56 Kb, w/ subscr. +5.41 Kb
Bacon: w/o subscr. 14.62 Kb, w/ subscr. +4.59 Kb
{
"name": "kefir",
"version": "0.1.8",
"version": "0.1.9",
"description": "Bacon.js inspired FRP library with less memory consumption",

@@ -39,3 +39,2 @@ "main": "dist/kefir.js",

"grunt-contrib-concat": "~0.4.0",
"grunt-contrib-jasmine": "~0.6.4",
"grunt-contrib-jshint": "~0.10.0",

@@ -47,2 +46,3 @@ "grunt-contrib-uglify": "~0.4.0",

"load-grunt-tasks": "~0.4.0",
"rx": "^2.2.21",
"semver": "^2.3.0",

@@ -49,0 +49,0 @@ "shelljs": "^0.3.0"

# Kefir
Bacon.js inspired FRP library with less memory consumption
Bacon.js inspired FRP library with [less memory consumption](https://github.com/pozadi/kefir/blob/master/memory-usage-results.txt)

@@ -5,0 +5,0 @@ [![Build Status](https://travis-ci.org/pozadi/kefir.svg?branch=master)](https://travis-ci.org/pozadi/kefir)

@@ -1,13 +0,1 @@

// TODO
//
// stream.skipWhile(f)
// observable.skip(n)
//
// observable.scan(seed, f)
// observable.diff(start, f)
//
// observable.skipDuplicates(isEqual)
var WithSourceStreamMixin = {

@@ -40,3 +28,3 @@ __Constructor: function(source) {

// observable.toProperty()
// observable.toProperty([initial])

@@ -89,3 +77,3 @@ Kefir.PropertyFromStream = function PropertyFromStream(source, initial){

// .scan()
// .scan(seed, fn)

@@ -119,3 +107,3 @@ Kefir.ScanProperty = function ScanProperty(source, seed, fn){

// Map
// .map(fn)

@@ -169,5 +157,18 @@ var MapMixin = {

// .diff(seed, fn)
// Filter
Observable.prototype.diff = function(prev, fn) {
return this.map(function(x){
var result = fn(prev, x);
prev = x;
return result;
})
}
// .filter(fn)
Observable.prototype.filter = function(fn) {

@@ -186,3 +187,3 @@ return this.map(function(x){

// TakeWhile
// .takeWhile(fn)

@@ -202,3 +203,3 @@ Observable.prototype.takeWhile = function(fn) {

// Take
// .take(n)

@@ -217,1 +218,56 @@ Observable.prototype.take = function(n) {

}
// .skip(n)
Observable.prototype.skip = function(n) {
return this.map(function(x){
if (n <= 0) {
return x;
} else {
n--;
return Kefir.NOTHING;
}
})
}
// .skipDuplicates([fn])
Observable.prototype.skipDuplicates = function(fn) {
var prev, hasPrev = false;
return this.map(function(x){
var result;
if (hasPrev && (fn ? fn(prev, x) : prev === x)) {
result = Kefir.NOTHING;
} else {
result = x;
}
hasPrev = true;
prev = x;
return result;
})
}
// .skipWhile(f)
Observable.prototype.skipWhile = function(fn) {
var skip = true;
return this.map(function(x){
if (skip && fn(x)) {
return Kefir.NOTHING;
} else {
skip = false;
return x;
}
})
}
// I am not sure this tests are correct
//
// Run: node --expose-gc --allow-natives-syntax test-memory-usage.js
//
// --allow-natives-syntax for %GetHeapUsage()
// --expose-gc for global.gc()
// Run: node --expose-gc test-memory-usage.js

@@ -11,31 +8,23 @@

var Bacon = require('baconjs');
var Rx = require('rx');
function diff(a, b) {
return ( (b - a) / 1024 / 1024 ).toFixed(2) + ' Mb';
function toMb(x) {
return ( x / 1024 / 1024 ).toFixed(2) + ' Mb';
}
var __lastMemoryUsageCache;
function toKb(x) {
return ( x / 1024 ).toFixed(2) + ' Kb';
}
var __lastMemoryUsage, __lastTime;
function begin(){
global.gc()
__lastMemoryUsageCache = process.memoryUsage();
// __lastMemoryUsageCache = %GetHeapUsage();
__lastMemoryUsage = process.memoryUsage().heapUsed;
__lastTime = Date.now();
}
function end(name){
global.gc()
var now = process.memoryUsage();
// var now = %GetHeapUsage();
// var report = name + ':\n';
// report += ' heapUsed ' + diff(__lastMemoryUsageCache.heapUsed, now.heapUsed) + '\n';
// report += ' heapTotal ' + diff(__lastMemoryUsageCache.heapTotal, now.heapTotal) + '\n';
// report += ' rss ' + diff(__lastMemoryUsageCache.rss, now.rss) + '\n';
// var report = name + ': ' + diff(__lastMemoryUsageCache.heapUsed, now.heapUsed)
// var report = name + ': ' + diff(__lastMemoryUsageCache, now)
// console.log(report);
return diff(__lastMemoryUsageCache.heapUsed, now.heapUsed);
return [process.memoryUsage().heapUsed - __lastMemoryUsage, Date.now() - __lastTime];
}

@@ -51,54 +40,97 @@

}
var withoutSubscribers = end()
var objects = null;
global.gc();
var withoutSubscr = end()
var objects = new Array(n);
begin()
for (var i = 0; i < objects.length; i++) {
objects[i] = generator(i);
objects[i].onValue(noop);
if (msg === 'Rx') {
objects[i].subscribe(noop);
} else {
objects[i].onValue(noop);
}
}
var withSubscribers = end()
var withSubscr = end();
var objects = null;
global.gc();
console.log(msg + ': w/o subscr. ' + withoutSubscribers + ', w. subscr. ' + withSubscribers);
var plus = withSubscr[0] > 0 ? '+' : '';
console.log(
msg
+ ': w/o subscr. ' + toKb(withoutSubscr[0]/n)
// + ' ' + (withoutSubscr[1]/n).toFixed(4) + ' ms'
+ ', w/ subscr. ' + plus + toKb(withSubscr[0]/n)
// + ' ' + (withSubscr[1]/n).toFixed(4) + ' ms'
);
}
function title(text){
console.log('\n' + text);
}
function noop(){}
// Just keeps references to listeners
var fakeSource = {
listeners: [],
subscribe: function(listener){
this.listeners.push(listener);
},
unsubscribe: function(listener){
var index = this.listeners.indexOf(listener);
if (index != -1) {
this.listeners.splice(index, 1);
}
}
}
console.log('\nnew Stream(noop, noop) x1000')
createNObservable('Kefir', 1000, function(){
return new Kefir.Stream(noop, noop);
})
function baseKefir(){
var stream = new Kefir.Stream(function(){
fakeSource.subscribe(send);
}, function(){
fakeSource.unsubscribe(send);
});
var send = stream.__sendValue.bind(stream);
return stream;
}
function baseRx(){
return new Rx.Observable.create(function(observer){
debugger
var send = function(x){
observer.onNext(x);
}
fakeSource.subscribe(send);
return function(){
fakeSource.unsubscribe(send);
}
});
}
function baseBacon(){
return new Bacon.EventStream(function(sink){
fakeSource.subscribe(sink);
return function(){
fakeSource.unsubscribe(sink);
}
});
}
console.log('\nnew Bus() x1000')
createNObservable('Kefir', 1000, function(){
return new Kefir.Bus();
})
createNObservable('Bacon', 1000, function(){
return new Bacon.Bus();
})
console.log('Generated by run: node --expose-gc test-memory-usage.js > memory-usage-results.txt')
console.log('Please don\'t take this results too serious, I am not 100% sure about correctness of this tests')
console.log('')
console.log('\n.fromBinder(noop) x1000')
createNObservable('Kefir', 1000, function(){
return Kefir.fromBinder(noop);
})
title('very base stream')
createNObservable('Bacon', 1000, function(){
return Bacon.fromBinder(noop);
})
createNObservable('Kefir', 700, baseKefir)
createNObservable('Rx', 700, baseRx)
createNObservable('Bacon', 700, baseBacon)

@@ -108,10 +140,10 @@

console.log('\nnew Bus().toProperty(1) x1000')
title('new Bus()')
createNObservable('Kefir', 1000, function(){
return new Kefir.Bus().toProperty(1);
createNObservable('Kefir', 700, function(){
return new Kefir.Bus();
})
createNObservable('Bacon', 1000, function(){
return new Bacon.Bus().toProperty(1);
createNObservable('Bacon', 700, function(){
return new Bacon.Bus();
})

@@ -121,10 +153,11 @@

console.log('\nnew Bus().toProperty(1).changes() x1000')
createNObservable('Kefir', 1000, function(){
return new Kefir.Bus().toProperty(1).changes();
title('.once(1)')
createNObservable('Kefir', 700, function(i){
return Kefir.once(i);
})
createNObservable('Bacon', 1000, function(){
return new Bacon.Bus().toProperty(1).changes();
createNObservable('Bacon', 700, function(i){
return Bacon.once(i);
})

@@ -134,36 +167,46 @@

console.log('\nnew Bus().map(noop) x1000')
createNObservable('Kefir', 1000, function(){
return new Kefir.Bus().map(noop);
title('.never()')
createNObservable('Kefir', 700, function(){
return Kefir.never();
})
createNObservable('Bacon', 1000, function(){
return new Bacon.Bus().map(noop);
createNObservable('Rx', 700, function(){
return Rx.Observable.never();
})
createNObservable('Bacon', 700, function(){
return Bacon.never();
})
console.log('\nnew Bus().scan(0, noop) x1000')
createNObservable('Kefir', 1000, function(){
return new Kefir.Bus().scan(0, noop);
title('.toProperty(1)')
createNObservable('Kefir', 700, function(){
return baseKefir().toProperty(1);
})
createNObservable('Bacon', 1000, function(){
return new Bacon.Bus().scan(0, noop);
createNObservable('Rx', 700, function(){
return baseRx().publishValue(1).refCount()
})
createNObservable('Bacon', 700, function(){
return baseBacon().toProperty(1);
})
console.log('\n.sequentially(0, [1, 2])')
createNObservable('Kefir', 1000, function(){
return Kefir.sequentially(0, [1, 2]);
title('.toProperty(1).changes()')
createNObservable('Kefir', 700, function(){
return baseKefir().toProperty(1).changes();
})
createNObservable('Bacon', 1000, function(){
return Bacon.sequentially(0, [1, 2]);
createNObservable('Bacon', 700, function(){
return baseBacon().toProperty(1).changes();
})

@@ -174,11 +217,14 @@

title('.map(noop)')
console.log('\nnew Bus().filter(noop) x1000')
createNObservable('Kefir', 700, function(){
return baseKefir().map(noop);
})
createNObservable('Kefir', 1000, function(){
return new Kefir.Bus().filter(noop);
createNObservable('Rx', 700, function(){
return baseRx().map(noop);
})
createNObservable('Bacon', 1000, function(){
return new Bacon.Bus().filter(noop);
createNObservable('Bacon', 700, function(){
return baseBacon().map(noop);
})

@@ -189,11 +235,14 @@

title('.filter(noop)')
console.log('\nnew Kefir.Bus().take(5) x1000')
createNObservable('Kefir', 700, function(){
return baseKefir().filter(noop);
})
createNObservable('Kefir', 1000, function(){
return new Kefir.Bus().take(5);
createNObservable('Rx', 700, function(){
return baseRx().filter(noop);
})
createNObservable('Bacon', 1000, function(){
return new Bacon.Bus().take(5);
createNObservable('Bacon', 700, function(){
return baseBacon().filter(noop);
})

@@ -204,11 +253,14 @@

title('.scan(0, noop)')
console.log('\nnew Bus().flatMap(noop) x1000')
createNObservable('Kefir', 700, function(){
return baseKefir().scan(0, noop);
})
createNObservable('Kefir', 1000, function(){
return new Kefir.Bus().flatMap(noop);
createNObservable('Rx', 700, function(){
return baseRx().scan(0, noop);
})
createNObservable('Bacon', 1000, function(){
return new Bacon.Bus().flatMap(noop);
createNObservable('Bacon', 700, function(){
return baseBacon().scan(0, noop);
})

@@ -219,10 +271,10 @@

console.log('\n.fromBinder(noop).combine(Kefir.fromBinder(noop), noop) x500')
title('.sequentially(0, [1, 2])')
createNObservable('Kefir', 500, function(){
return Kefir.fromBinder(noop).combine(Kefir.fromBinder(noop), noop);
createNObservable('Kefir', 700, function(){
return Kefir.sequentially(0, [1, 2]);
})
createNObservable('Bacon', 500, function(){
return Bacon.fromBinder(noop).combine(Bacon.fromBinder(noop), noop);
createNObservable('Bacon', 700, function(){
return Bacon.sequentially(0, [1, 2]);
})

@@ -233,84 +285,84 @@

console.log('\n.once(1) x1000')
createNObservable('Kefir', 1000, function(i){
return Kefir.once(i);
title('.take(5)')
createNObservable('Kefir', 700, function(){
return baseKefir().take(5);
})
createNObservable('Bacon', 1000, function(i){
return Bacon.once(i);
createNObservable('Rx', 700, function(){
return baseRx().take(5);
})
createNObservable('Bacon', 700, function(){
return baseBacon().take(5);
})
console.log('\n.never() x1000')
createNObservable('Kefir', 1000, function(){
return Kefir.never();
title('.flatMap(noop)')
createNObservable('Kefir', 700, function(){
return baseKefir().flatMap(noop);
})
createNObservable('Bacon', 1000, function(){
return Bacon.never();
createNObservable('Rx', 700, function(){
return baseRx().flatMap(noop);
})
createNObservable('Bacon', 700, function(){
return baseBacon().flatMap(noop);
})
console.log('\n.combineAsArray(bus, bus, bus, bus) x300')
createNObservable('Kefir', 300, function(){
return Kefir.combine([new Kefir.Bus(), new Kefir.Bus(), new Kefir.Bus(), new Kefir.Bus()]);
title('.combine(stream, noop)')
createNObservable('Kefir', 700, function(){
return baseKefir().combine(baseKefir(), noop);
})
createNObservable('Bacon', 300, function(){
return Bacon.combineAsArray(new Bacon.Bus(), new Bacon.Bus(), new Bacon.Bus(), new Bacon.Bus());
createNObservable('Rx', 700, function(){
return baseRx().combineLatest(baseRx(), noop);
})
createNObservable('Bacon', 700, function(){
return baseBacon().combine(baseBacon(), noop);
})
console.log('\n.mergeAll(bus, bus, bus, bus) x300')
createNObservable('Kefir', 300, function(){
return Kefir.merge(new Kefir.Bus(), new Kefir.Bus(), new Kefir.Bus(), new Kefir.Bus());
title('.combineAsArray(stream1, stream2, stream3, stream4)')
createNObservable('Kefir', 500, function(){
return Kefir.combine([baseKefir(), baseKefir(), baseKefir(), baseKefir()]);
})
createNObservable('Bacon', 300, function(){
return Bacon.mergeAll(new Bacon.Bus(), new Bacon.Bus(), new Bacon.Bus(), new Bacon.Bus());
createNObservable('Rx', 500, function(){
return Rx.Observable.forkJoin(baseRx(), baseRx(), baseRx(), baseRx());
})
createNObservable('Bacon', 500, function(){
return Bacon.combineAsArray(baseBacon(), baseBacon(), baseBacon(), baseBacon());
})
console.log('\ncrazy x100')
createNObservable('Kefir', 100, function(){
return (new Kefir.Bus())
.merge(Kefir.fromBinder(noop))
.combine([Kefir.once(1)], noop)
.scan(0, noop)
.changes()
.merge(Kefir.never().map(noop))
.flatMap(noop)
.take(5)
.filter(noop)
.merge(Kefir.sequentially(0, [1, 2]))
.combine([Kefir.fromBinder(noop)], noop);
title('.mergeAll(stream1, stream2, stream3, stream4)')
createNObservable('Kefir', 500, function(){
return Kefir.merge(baseKefir(), baseKefir(), baseKefir(), baseKefir());
})
createNObservable('Bacon', 100, function(){
return (new Bacon.Bus())
.merge(Bacon.fromBinder(noop))
.combine(Bacon.once(1), noop)
.scan(0, noop)
.changes()
.merge(Bacon.never().map(noop))
.flatMap(noop)
.take(5)
.filter(noop)
.merge(Bacon.sequentially(0, [1, 2]))
.combine(Bacon.fromBinder(noop), noop);
createNObservable('Rx', 500, function(){
return Rx.Observable.merge(baseRx(), baseRx(), baseRx(), baseRx());
})
createNObservable('Bacon', 500, function(){
return Bacon.mergeAll(baseBacon(), baseBacon(), baseBacon(), baseBacon());
})
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
/*! kefir - 0.1.8
/*! kefir - 0.1.9
* https://github.com/pozadi/kefir

@@ -424,14 +424,2 @@ */

// TODO
//
// stream.skipWhile(f)
// observable.skip(n)
//
// observable.scan(seed, f)
// observable.diff(start, f)
//
// observable.skipDuplicates(isEqual)
var WithSourceStreamMixin = {

@@ -464,3 +452,3 @@ __Constructor: function(source) {

// observable.toProperty()
// observable.toProperty([initial])

@@ -513,3 +501,3 @@ Kefir.PropertyFromStream = function PropertyFromStream(source, initial){

// .scan()
// .scan(seed, fn)

@@ -543,3 +531,3 @@ Kefir.ScanProperty = function ScanProperty(source, seed, fn){

// Map
// .map(fn)

@@ -593,5 +581,18 @@ var MapMixin = {

// .diff(seed, fn)
// Filter
Observable.prototype.diff = function(prev, fn) {
return this.map(function(x){
var result = fn(prev, x);
prev = x;
return result;
})
}
// .filter(fn)
Observable.prototype.filter = function(fn) {

@@ -610,3 +611,3 @@ return this.map(function(x){

// TakeWhile
// .takeWhile(fn)

@@ -626,3 +627,3 @@ Observable.prototype.takeWhile = function(fn) {

// Take
// .take(n)

@@ -642,2 +643,57 @@ Observable.prototype.take = function(n) {

// .skip(n)
Observable.prototype.skip = function(n) {
return this.map(function(x){
if (n <= 0) {
return x;
} else {
n--;
return Kefir.NOTHING;
}
})
}
// .skipDuplicates([fn])
Observable.prototype.skipDuplicates = function(fn) {
var prev, hasPrev = false;
return this.map(function(x){
var result;
if (hasPrev && (fn ? fn(prev, x) : prev === x)) {
result = Kefir.NOTHING;
} else {
result = x;
}
hasPrev = true;
prev = x;
return result;
})
}
// .skipWhile(f)
Observable.prototype.skipWhile = function(fn) {
var skip = true;
return this.map(function(x){
if (skip && fn(x)) {
return Kefir.NOTHING;
} else {
skip = false;
return x;
}
})
}
// TODO

@@ -1108,3 +1164,3 @@ //

},{"../../dist/kefir.js":1,"../test-helpers":22}],3:[function(require,module,exports){
},{"../../dist/kefir.js":1,"../test-helpers":26}],3:[function(require,module,exports){
var Kefir = require('../../dist/kefir.js');

@@ -1288,3 +1344,3 @@ var helpers = require('../test-helpers');

},{"../../dist/kefir.js":1,"../test-helpers":22}],4:[function(require,module,exports){
},{"../../dist/kefir.js":1,"../test-helpers":26}],4:[function(require,module,exports){
var Kefir = require('../../dist/kefir.js');

@@ -1295,2 +1351,85 @@ var helpers = require('../test-helpers');

describe(".diff()", function(){
function subtract(prev, next){
return next - prev;
}
it("stream.diff()", function(){
var stream = new Kefir.Stream();
var diffs = stream.diff(0, subtract);
expect(diffs).toEqual(jasmine.any(Kefir.Stream));
var result = helpers.getOutput(diffs);
stream.__sendValue(1);
stream.__sendValue(2);
stream.__sendValue(4);
stream.__sendEnd();
expect(result).toEqual({
ended: true,
xs: [1, 1, 2]
});
});
it("property.diff()", function(){
var prop = new Kefir.Property(null, null, 6);
var diffs = prop.diff(5, subtract);
expect(diffs).toEqual(jasmine.any(Kefir.Property));
expect(diffs.hasCached()).toBe(true);
expect(diffs.getCached()).toBe(1);
var result = helpers.getOutput(diffs);
prop.__sendValue(1);
prop.__sendValue(2);
prop.__sendValue(4);
prop.__sendEnd();
expect(result).toEqual({
ended: true,
xs: [1, -5, 1, 2]
});
});
it("property.diff() w/o initial", function(){
var prop = new Kefir.Property(null, null);
var diffs = prop.diff(5, subtract);
expect(diffs).toEqual(jasmine.any(Kefir.Property));
expect(diffs.hasCached()).toBe(false);
expect(diffs.getCached()).toBe(Kefir.NOTHING);
var result = helpers.getOutput(diffs);
prop.__sendValue(1);
prop.__sendValue(2);
prop.__sendValue(4);
prop.__sendEnd();
expect(result).toEqual({
ended: true,
xs: [-4, 1, 2]
});
});
});
},{"../../dist/kefir.js":1,"../test-helpers":26}],5:[function(require,module,exports){
var Kefir = require('../../dist/kefir.js');
var helpers = require('../test-helpers');
describe(".filter()", function(){

@@ -1378,3 +1517,3 @@

},{"../../dist/kefir.js":1,"../test-helpers":22}],5:[function(require,module,exports){
},{"../../dist/kefir.js":1,"../test-helpers":26}],6:[function(require,module,exports){
var Kefir = require('../../dist/kefir.js');

@@ -1487,3 +1626,3 @@ var helpers = require('../test-helpers');

},{"../../dist/kefir.js":1,"../test-helpers":22}],6:[function(require,module,exports){
},{"../../dist/kefir.js":1,"../test-helpers":26}],7:[function(require,module,exports){
var Kefir = require('../../dist/kefir.js');

@@ -1542,3 +1681,3 @@ var helpers = require('../test-helpers');

},{"../../dist/kefir.js":1,"../test-helpers":22}],7:[function(require,module,exports){
},{"../../dist/kefir.js":1,"../test-helpers":26}],8:[function(require,module,exports){
var Kefir = require('../../dist/kefir.js');

@@ -1617,3 +1756,3 @@ var helpers = require('../test-helpers');

},{"../../dist/kefir.js":1,"../test-helpers":22}],8:[function(require,module,exports){
},{"../../dist/kefir.js":1,"../test-helpers":26}],9:[function(require,module,exports){
var Kefir = require('../../dist/kefir.js');

@@ -1658,3 +1797,3 @@ var helpers = require('../test-helpers');

},{"../../dist/kefir.js":1,"../test-helpers":22}],9:[function(require,module,exports){
},{"../../dist/kefir.js":1,"../test-helpers":26}],10:[function(require,module,exports){
// var Kefir = require('../../dist/kefir.js');

@@ -1747,3 +1886,3 @@ // var helpers = require('../test-helpers');

},{}],10:[function(require,module,exports){
},{}],11:[function(require,module,exports){
var Kefir = require('../../dist/kefir.js');

@@ -1836,3 +1975,3 @@ var helpers = require('../test-helpers');

},{"../../dist/kefir.js":1,"../test-helpers":22}],11:[function(require,module,exports){
},{"../../dist/kefir.js":1,"../test-helpers":26}],12:[function(require,module,exports){
var Kefir = require('../../dist/kefir.js');

@@ -1901,3 +2040,3 @@ var helpers = require('../test-helpers');

},{"../../dist/kefir.js":1,"../test-helpers":22}],12:[function(require,module,exports){
},{"../../dist/kefir.js":1,"../test-helpers":26}],13:[function(require,module,exports){
var Kefir = require('../../dist/kefir.js');

@@ -1936,3 +2075,3 @@ var helpers = require('../test-helpers');

},{"../../dist/kefir.js":1,"../test-helpers":22}],13:[function(require,module,exports){
},{"../../dist/kefir.js":1,"../test-helpers":26}],14:[function(require,module,exports){
var Kefir = require('../../dist/kefir.js');

@@ -1973,3 +2112,3 @@ var helpers = require('../test-helpers');

},{"../../dist/kefir.js":1,"../test-helpers":22}],14:[function(require,module,exports){
},{"../../dist/kefir.js":1,"../test-helpers":26}],15:[function(require,module,exports){
var Kefir = require('../../dist/kefir.js');

@@ -2154,3 +2293,3 @@ var helpers = require('../test-helpers');

},{"../../dist/kefir.js":1,"../test-helpers":22}],15:[function(require,module,exports){
},{"../../dist/kefir.js":1,"../test-helpers":26}],16:[function(require,module,exports){
var Kefir = require('../../dist/kefir.js');

@@ -2192,3 +2331,3 @@ var helpers = require('../test-helpers');

},{"../../dist/kefir.js":1,"../test-helpers":22}],16:[function(require,module,exports){
},{"../../dist/kefir.js":1,"../test-helpers":26}],17:[function(require,module,exports){
var Kefir = require('../../dist/kefir.js');

@@ -2339,3 +2478,3 @@ var helpers = require('../test-helpers');

},{"../../dist/kefir.js":1,"../test-helpers":22}],17:[function(require,module,exports){
},{"../../dist/kefir.js":1,"../test-helpers":26}],18:[function(require,module,exports){
var Kefir = require('../../dist/kefir.js');

@@ -2383,3 +2522,3 @@ var helpers = require('../test-helpers');

},{"../../dist/kefir.js":1,"../test-helpers":22}],18:[function(require,module,exports){
},{"../../dist/kefir.js":1,"../test-helpers":26}],19:[function(require,module,exports){
var Kefir = require('../../dist/kefir.js');

@@ -2469,3 +2608,3 @@ var helpers = require('../test-helpers');

},{"../../dist/kefir.js":1,"../test-helpers":22}],19:[function(require,module,exports){
},{"../../dist/kefir.js":1,"../test-helpers":26}],20:[function(require,module,exports){
var Kefir = require('../../dist/kefir.js');

@@ -2505,3 +2644,3 @@ var helpers = require('../test-helpers');

},{"../../dist/kefir.js":1,"../test-helpers":22}],20:[function(require,module,exports){
},{"../../dist/kefir.js":1,"../test-helpers":26}],21:[function(require,module,exports){
var Kefir = require('../../dist/kefir.js');

@@ -2512,2 +2651,294 @@ var helpers = require('../test-helpers');

describe(".skipDuplicates()", function(){
it("stream.skipDuplicates()", function(){
var stream = new Kefir.Stream();
var mapped = stream.skipDuplicates();
var result = helpers.getOutput(mapped);
stream.__sendValue(null);
stream.__sendValue(null);
stream.__sendValue(undefined);
stream.__sendValue(undefined);
stream.__sendValue(false);
stream.__sendValue(0);
stream.__sendValue(1);
stream.__sendValue(1);
stream.__sendValue(1);
stream.__sendValue(2);
stream.__sendValue(2);
stream.__sendValue(3);
stream.__sendEnd();
expect(result).toEqual({
ended: true,
xs: [null, undefined, false, 0, 1, 2, 3]
});
});
it("property.skipDuplicates()", function(){
var prop = new Kefir.Property(null, null, 5);
var mapped = prop.skipDuplicates();
expect(mapped).toEqual(jasmine.any(Kefir.Property));
expect(mapped.hasCached()).toBe(true);
expect(mapped.getCached()).toBe(5);
var result = helpers.getOutput(mapped);
prop.__sendValue(null);
prop.__sendValue(null);
prop.__sendValue(undefined);
prop.__sendValue(undefined);
prop.__sendValue(false);
prop.__sendValue(0);
prop.__sendValue(1);
prop.__sendValue(1);
prop.__sendValue(1);
prop.__sendValue(2);
prop.__sendValue(2);
prop.__sendValue(3);
prop.__sendEnd();
expect(result).toEqual({
ended: true,
xs: [5, null, undefined, false, 0, 1, 2, 3]
});
});
it("property.skipDuplicates() w/o initial", function(){
var prop = new Kefir.Property();
var mapped = prop.skipDuplicates();
expect(mapped).toEqual(jasmine.any(Kefir.Property));
expect(mapped.hasCached()).toBe(false);
expect(mapped.getCached()).toBe(Kefir.NOTHING);
var result = helpers.getOutput(mapped);
prop.__sendValue(null);
prop.__sendValue(null);
prop.__sendValue(undefined);
prop.__sendValue(undefined);
prop.__sendValue(false);
prop.__sendValue(0);
prop.__sendValue(1);
prop.__sendValue(1);
prop.__sendValue(1);
prop.__sendValue(2);
prop.__sendValue(2);
prop.__sendValue(3);
prop.__sendEnd();
expect(result).toEqual({
ended: true,
xs: [null, undefined, false, 0, 1, 2, 3]
});
});
it("stream.skipDuplicates(fn)", function(){
var stream = new Kefir.Stream();
var mapped = stream.skipDuplicates(function(a, b){ return a == b });
var result = helpers.getOutput(mapped);
stream.__sendValue(null);
stream.__sendValue(null);
stream.__sendValue(undefined);
stream.__sendValue(undefined);
stream.__sendValue(false);
stream.__sendValue(0);
stream.__sendValue(1);
stream.__sendValue(1);
stream.__sendValue(1);
stream.__sendValue(2);
stream.__sendValue(2);
stream.__sendValue(3);
stream.__sendEnd();
expect(result).toEqual({
ended: true,
xs: [null, false, 1, 2, 3]
});
});
it("property.skipDuplicates(fn)", function(){
var prop = new Kefir.Property(null, null, 5);
var mapped = prop.skipDuplicates(function(a, b){ return a == b });
expect(mapped).toEqual(jasmine.any(Kefir.Property));
expect(mapped.hasCached()).toBe(true);
expect(mapped.getCached()).toBe(5);
var result = helpers.getOutput(mapped);
prop.__sendValue(null);
prop.__sendValue(null);
prop.__sendValue(undefined);
prop.__sendValue(undefined);
prop.__sendValue(false);
prop.__sendValue(0);
prop.__sendValue(1);
prop.__sendValue(1);
prop.__sendValue(1);
prop.__sendValue(2);
prop.__sendValue(2);
prop.__sendValue(3);
prop.__sendEnd();
expect(result).toEqual({
ended: true,
xs: [5, null, false, 1, 2, 3]
});
});
});
},{"../../dist/kefir.js":1,"../test-helpers":26}],22:[function(require,module,exports){
var Kefir = require('../../dist/kefir.js');
var helpers = require('../test-helpers');
describe(".skipWhile(fn)", function(){
function lessThan3(x){
return x < 3;
}
it("stream.skipWhile(fn)", function(){
var stream = new Kefir.Stream();
var mapped = stream.skipWhile(lessThan3);
var result = helpers.getOutput(mapped);
stream.__sendValue(1);
stream.__sendValue(2);
stream.__sendValue(3);
stream.__sendValue(4);
stream.__sendValue(1);
stream.__sendEnd();
expect(result).toEqual({
ended: true,
xs: [3, 4, 1]
});
});
it("property.skipWhile(fn) skip initial", function(){
var prop = new Kefir.Property(null, null, 1);
var mapped = prop.skipWhile(lessThan3);
expect(mapped).toEqual(jasmine.any(Kefir.Property));
expect(mapped.hasCached()).toBe(false);
expect(mapped.getCached()).toBe(Kefir.NOTHING);
var result = helpers.getOutput(mapped);
prop.__sendValue(2);
prop.__sendValue(3);
prop.__sendValue(4);
prop.__sendValue(1);
prop.__sendEnd();
expect(result).toEqual({
ended: true,
xs: [3, 4, 1]
});
});
it("property.skipWhile(fn) not skip initial", function(){
var prop = new Kefir.Property(null, null, 5);
var mapped = prop.skipWhile(lessThan3);
expect(mapped).toEqual(jasmine.any(Kefir.Property));
expect(mapped.hasCached()).toBe(true);
expect(mapped.getCached()).toBe(5);
var result = helpers.getOutput(mapped);
prop.__sendValue(2);
prop.__sendValue(3);
prop.__sendValue(4);
prop.__sendEnd();
expect(result).toEqual({
ended: true,
xs: [5, 2, 3, 4]
});
});
});
},{"../../dist/kefir.js":1,"../test-helpers":26}],23:[function(require,module,exports){
var Kefir = require('../../dist/kefir.js');
var helpers = require('../test-helpers');
describe(".skip()", function(){
it("ok", function(){
var stream = new Kefir.Stream();
var skip2 = stream.skip(2);
var skip10 = stream.skip(10);
var result2 = helpers.getOutput(skip2);
var result10 = helpers.getOutput(skip10);
stream.__sendAny(Kefir.bunch(1, 2, 3, 4, Kefir.END));
expect(result2).toEqual({
ended: true,
xs: [3, 4]
})
expect(result10).toEqual({
ended: true,
xs: []
})
});
});
},{"../../dist/kefir.js":1,"../test-helpers":26}],24:[function(require,module,exports){
var Kefir = require('../../dist/kefir.js');
var helpers = require('../test-helpers');
describe(".takeWhile()", function(){

@@ -2536,3 +2967,3 @@

},{"../../dist/kefir.js":1,"../test-helpers":22}],21:[function(require,module,exports){
},{"../../dist/kefir.js":1,"../test-helpers":26}],25:[function(require,module,exports){
var Kefir = require('../../dist/kefir.js');

@@ -2573,3 +3004,3 @@ var helpers = require('../test-helpers');

},{"../../dist/kefir.js":1,"../test-helpers":22}],22:[function(require,module,exports){
},{"../../dist/kefir.js":1,"../test-helpers":26}],26:[function(require,module,exports){
var Kefir = require('../dist/kefir.js');

@@ -2591,2 +3022,2 @@

},{"../dist/kefir.js":1}]},{},[2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])
},{"../dist/kefir.js":1}]},{},[2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25])
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