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.1 to 0.1.2

2

dist/kefir.js

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

/*! kefir - 0.1.1
/*! kefir - 0.1.2
* https://github.com/pozadi/kefir

@@ -3,0 +3,0 @@ */

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

/*! kefir - 0.1.1
/*! kefir - 0.1.2
* 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){var b=function(){};return b.prototype=a,new b}function e(a,b){for(var d in b)c(b,d)&&(a[d]=b[d])}function f(a,b,c){return a.prototype=d(b.prototype),a.prototype.constructor=a,c&&e(a.prototype,c),a}function g(a,b){for(var c=0;c<a.length;)a[c]===b?a.splice(c,1):c++}function h(a){for(var b=0;b<a.length;b++)if(a[b])return!1;return!0}function i(a){return"[object Array]"===Object.prototype.toString.call(a[0])?a[0]:Array.prototype.slice.call(a)}var j={};j.END=["<end>"],j.NO_MORE=["<no more>"];var k=j.Stream=f(function(a,b){"function"==typeof a&&(this.__onFirstIn=a),"function"==typeof a&&(this.__onLastOut=b),this.__subscribers=[],this.__contexts=[],this.__endSubscribers=[],this.__endContexts=[]},Object,{_send:function(a){if(!this.isEnded())if(a===j.END)this.__end();else for(var b=0;b<this.__subscribers.length;b++){var c=this.__subscribers[b],d=this.__contexts[b];"function"==typeof c&&j.NO_MORE===c.call(d,a)&&this.off(c,d)}},on:function(a,b){this.isEnded()||(this.__subscribers.push(a),this.__contexts.push(b),1===this.__subscribers.length&&this.__onFirstIn())},off:function(a,b){if(!this.isEnded()){for(var c=0;c<this.__subscribers.length;c++)this.__subscribers[c]===a&&this.__contexts[c]===b&&(this.__subscribers[c]=null,this.__contexts[c]=null);h(this.__subscribers)&&(this.__subscribers=[],this.__contexts=[],this.__onLastOut())}},onEnd:function(a,b){this.isEnded()?a():(this.__endSubscribers.push(a),this.__endContexts.push(b))},offEnd:function(a,b){if(!this.isEnded())for(var c=0;c<this.__endSubscribers.length;c++)this.__endSubscribers[c]===a&&this.__endContexts[c]===b&&(this.__endSubscribers[c]=null,this.__endContexts[c]=null)},isEnded:function(){return null===this.__subscribers},hasSubscribers:function(){return!this.isEnded()&&this.__subscribers.length>0},__onFirstIn:b,__onLastOut:b,__sendEnd:function(){this._send(j.END)},__end:function(){if(!this.isEnded()){this.__onLastOut(),c(this,"__onFirstIn")&&(this.__onFirstIn=null),c(this,"__onLastOut")&&(this.__onLastOut=null),this.__subscribers=null,this.__contexts=null;for(var a=0;a<this.__endSubscribers.length;a++)"function"==typeof this.__endSubscribers[a]&&this.__endSubscribers[a].call(this.__endContexts[a]);this.__endSubscribers=null,this.__endContexts=null}}}),l=d(k.prototype);l.__subscribers=null,j.never=function(){return l};var m=j.OnceStream=f(function(a){k.call(this),this.__value=a},k,{__onFirstIn:function(){this._send(this.__value),this.__value=null,this._send(j.END)}});j.once=function(a){return new m(a)};var n=j.Property=f(function(a,b,c){k.call(this,a,b),this.__hasCached="undefined"!=typeof c,this.__cached=c},k,{onChanges:function(a,b){k.prototype.on.call(this,a,b)},on:function(a,b){this.__hasCached&&a(this.__cached),this.onChanges(a,b)},_send:function(a){this.isEnded()||(this.__hasCached=!0,this.__cached=a),k.prototype._send.call(this,a)}}),o=j.PropertyFromStream=f(function(a,b){n.call(this,null,null,b),this.__sourceStream=a,a.onEnd(this.__sendEnd,this)},n,{__onFirstIn:function(){this.__sourceStream.on(this._send,this)},__onLastOut:function(){this.__sourceStream.off(this._send,this)},__end:function(){k.prototype.__end.call(this),this.__sourceStream=null}});j.toProperty=function(a,b){return new o(a,b)},k.prototype.toProperty=function(a){return j.toProperty(this,a)};var p=j.PropertyChangesStream=f(function(a){k.call(this),this.__sourceProperty=a;var b=this;a.onEnd(function(){b._send(j.END)})},k,{__onFirstIn:function(){this.__sourceProperty.onChanges(this._send,this)},__onLastOut:function(){this.__sourceProperty.off(this._send,this)},__end:function(){k.prototype.__end.call(this),this.__sourceProperty=null}});j.changes=function(a){return new p(a)},n.prototype.changes=function(){return j.changes(this)};var q=j.FromBinderStream=f(function(a){k.call(this),this.__generator=a;var b=this;this.__deliver=function(a){b._send(a)}},k,{__onFirstIn:function(){this.__generatorUsubscriber=this.__generator(this.__deliver)},__onLastOut:function(){"function"==typeof this.__generatorUsubscriber&&this.__generatorUsubscriber(),this.__generatorUsubscriber=null},__end:function(){k.prototype.__end.call(this),this.__generator=null,this.__deliver=null}});j.fromBinder=function(a){return new q(a)};var r=(j.Bus=f(function(){k.call(this),this.__plugged=[]},k,{push:function(a){this._send(a)},plug:function(a){if(!this.isEnded()){this.__plugged.push(a),this.hasSubscribers()&&a.on(this._send,this);var b=this;a.onEnd(function(){b.unplug(a)})}},unplug:function(a){this.isEnded()||(a.off(this._send,this),g(this.__plugged,a))},end:function(){this._send(j.END)},__onFirstIn:function(){for(var a=0;a<this.__plugged.length;a++)this.__plugged[a].on(this._send,this)},__onLastOut:function(){for(var a=0;a<this.__plugged.length;a++)this.__plugged[a].off(this._send,this)},__end:function(){k.prototype.__end.call(this),this.__plugged=null,this.push=b}}),j.FromPollStream=f(function(a,b){k.call(this),this.__interval=a,this.__intervalId=null;var c=this;this.__deliver=function(){c._send(b())}},k,{__onFirstIn:function(){this.__intervalId=setInterval(this.__deliver,this.__interval)},__onLastOut:function(){null!==this.__intervalId&&(clearInterval(this.__intervalId),this.__intervalId=null)},__end:function(){k.prototype.__end.call(this),this.__deliver=null}}));j.fromPoll=function(a,b){return new r(a,b)},j.interval=function(a,b){return new r(a,function(){return b})},j.sequentially=function(a,b){return b=b.slice(0),new r(a,function(){return 0===b.length?j.END:b.shift()})},j.repeatedly=function(a,b){var c=-1;return new r(a,function(){return b[++c%b.length]})};var s=j.MappedStream=f(function(a,b){k.call(this),this.__sourceStream=a,this.__mapFn=b,a.onEnd(this.__sendEnd,this)},k,{__mapAndSend:function(a){this._send(this.__mapFn(a))},__onFirstIn:function(){this.__sourceStream.on(this.__mapAndSend,this)},__onLastOut:function(){this.__sourceStream.off(this.__mapAndSend,this)},__end:function(){k.prototype.__end.call(this),this.__sourceStream=null,this.__mapFn=null}});j.map=function(a,b){return new s(a,b)},k.prototype.map=function(a){return j.map(this,a)};var t=j.FilteredStream=f(function(a,b){s.call(this,a,b)},s,{__mapAndSend:function(a){this.__mapFn(a)&&this._send(a)}});j.filter=function(a,b){return new t(a,b)},k.prototype.filter=function(a){return j.filter(this,a)};var u=j.TakeWhileStream=f(function(a,b){s.call(this,a,b)},s,{__mapAndSend:function(a){this._send(this.__mapFn(a)?a:j.END)}});j.takeWhile=function(a,b){return new u(a,b)},k.prototype.takeWhile=function(a){return j.takeWhile(this,a)},j.take=function(a,b){return new u(a,function(){return b-->0})},k.prototype.take=function(a){return j.take(this,a)};var v=j.FlatMappedStream=f(function(a,b){k.call(this),this.__sourceStream=a,this.__plugged=[],this.__mapFn=b,a.onEnd(this.__sendEnd,this)},k,{__plugResult:function(a){this.__plug(this.__mapFn(a))},__onFirstIn:function(){this.__sourceStream.on(this.__plugResult,this);for(var a=0;a<this.__plugged.length;a++)this.__plugged[a].on(this._send,this)},__onLastOut:function(){this.__sourceStream.off(this.__plugResult,this);for(var a=0;a<this.__plugged.length;a++)this.__plugged[a].off(this._send,this)},__plug:function(a){this.__plugged.push(a),this.hasSubscribers()&&a.on(this._send,this);var b=this;a.onEnd(function(){b.__unplug(a)})},__unplug:function(a){this.isEnded()||(a.off(this._send,this),g(this.__plugged,a))},__end:function(){k.prototype.__end.call(this),this.__sourceStream=null,this.__mapFn=null,this.__plugged=null}});j.flatMap=function(a,b){return new v(a,b)},k.prototype.flatMap=function(a){return j.flatMap(this,a)};var w=j.MergedStream=f(function(){k.call(this),this.__sourceStreams=i(arguments);for(var a=0;a<this.__sourceStreams.length;a++)this.__sourceStreams[a].onEnd(this.__unplugFor(this.__sourceStreams[a]))},k,{__onFirstIn:function(){for(var a=0;a<this.__sourceStreams.length;a++)this.__sourceStreams[a].on(this._send,this)},__onLastOut:function(){for(var a=0;a<this.__sourceStreams.length;a++)this.__sourceStreams[a].off(this._send,this)},__unplug:function(a){a.off(this._send,this),g(this.__sourceStreams,a),0===this.__sourceStreams.length&&this._send(j.END)},__unplugFor:function(a){var b=this;return function(){b.__unplug(a)}},__end:function(){k.prototype.__end.call(this),this.__sourceStreams=null}});j.merge=function(){return new w(i(arguments))},k.prototype.merge=function(){return j.merge([this].concat(i(arguments)))};var x=j.CombinedStream=f(function(a,b){k.call(this),this.__sourceStreams=a,this.__cachedValues=new Array(a.length),this.__hasCached=new Array(a.length),this.__receiveFns=new Array(a.length),this.__mapFn=b;for(var c=0;c<this.__sourceStreams.length;c++)this.__receiveFns[c]=this.__receiveFor(c),this.__sourceStreams[c].onEnd(this.__unplugFor(c))},k,{__onFirstIn:function(){for(var a=0;a<this.__sourceStreams.length;a++)this.__sourceStreams[a]&&this.__sourceStreams[a].on(this.__receiveFns[a])},__onLastOut:function(){for(var a=0;a<this.__sourceStreams.length;a++)this.__sourceStreams[a]&&this.__sourceStreams[a].off(this.__receiveFns[a])},__unplug:function(a){this.__sourceStreams[a].off(this.__receiveFns[a]),this.__sourceStreams[a]=null,this.__receiveFns[a]=null,h(this.__sourceStreams)&&this._send(j.END)},__unplugFor:function(a){var b=this;return function(){b.__unplug(a)}},__receive:function(a,b){this.__hasCached[a]=!0,this.__cachedValues[a]=b,this.__allCached()&&this._send("function"==typeof this.__mapFn?this.__mapFn.apply(null,this.__cachedValues):this.__cachedValues.slice(0))},__receiveFor:function(a){var b=this;return function(c){b.__receive(a,c)}},__allCached:function(){for(var a=0;a<this.__hasCached.length;a++)if(!this.__hasCached[a])return!1;return!0},__end:function(){k.prototype.__end.call(this),this.__sourceStreams=null,this.__cachedValues=null,this.__hasCached=null,this.__receiveFns=null,this.__mapFn=null}});j.combine=function(a,b){return new x(a,b)},k.prototype.combine=function(a,b){return j.combine([this].concat(a),b)},k.prototype.log=function(a){function b(b){a?console.log(a,b):console.log(b)}this.on(b),this.onEnd(function(){b(j.END)})},"function"==typeof define&&define.amd?(define([],function(){return j}),a.Kefir=j):"object"==typeof module&&"object"==typeof exports?(module.exports=j,j.Kefir=j):a.Kefir=j}(this);
{
"name": "kefir",
"version": "0.1.1",
"version": "0.1.2",
"description": "Bacon.js inspired FRP library with less memory consumption",

@@ -12,3 +12,13 @@ "main": "dist/kefir.js",

"bacon",
"bacon.js"
"bacon.js",
"kefir",
"kefir.js",
"functional",
"reactive",
"stream",
"streams",
"EventStream",
"Rx",
"RxJs",
"Observable"
],

@@ -15,0 +25,0 @@ "author": "Roman Pominov <rpominov@gmail.com>",

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