Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

reflux

Package Overview
Dependencies
Maintainers
1
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

reflux - npm Package Compare versions

Comparing version 0.2.6 to 0.2.7

2

bower.json
{
"name": "reflux",
"version": "0.2.4",
"version": "0.2.7",
"homepage": "https://github.com/spoike/reflux",

@@ -5,0 +5,0 @@ "authors": [

@@ -5,2 +5,8 @@ # Changelog

## v0.2.7
* Fixed IE8 errors and warnings [#286](https://github.com/spoike/refluxjs/pull/286), [#270](https://github.com/spoike/refluxjs/pull/270)
* Ensure triggerPromise original promise [#229](https://github.com/spoike/refluxjs/pull/229)
* Fixed aborted callbacks [#227](https://github.com/spoike/refluxjs/pull/227)
## v0.2.6

@@ -7,0 +13,0 @@

@@ -516,6 +516,10 @@ !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.Reflux=e()}}(function(){var define,module,exports;return (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(_dereq_,module,exports){

var eventHandler = function(args) {
if (aborted){
return;
}
callback.apply(bindContext, args);
}, me = this;
}, me = this, aborted = false;
this.emitter.addListener(this.eventLabel, eventHandler);
return function() {
aborted = true;
me.emitter.removeListener(me.eventLabel, eventHandler);

@@ -558,4 +562,5 @@ };

bindContext = bindContext || this;
this.willCallPromise = (this.willCallPromise || 0) + 1;
return this.listen(function() {
var removeListen = this.listen(function() {

@@ -570,2 +575,8 @@ if (!callback) {

}, bindContext);
return function () {
me.willCallPromise--;
removeListen.call(me);
};
},

@@ -597,2 +608,8 @@

* Returns a Promise for the triggered action
*
* @return {Promise}
* Resolved by completed child action.
* Rejected by failed child action.
* If listenAndPromise'd, then promise associated to this trigger.
* Otherwise, the promise is for next child action completion.
*/

@@ -608,2 +625,18 @@ triggerPromise: function(){

var promise = _.createPromise(function(resolve, reject) {
// If `listenAndPromise` is listening
// patch `promise` w/ context-loaded resolve/reject
if (me.willCallPromise) {
_.nextTick(function() {
var old_promise_method = me.promise;
me.promise = function (promise) {
promise.then(resolve, reject);
// Back to your regularly schedule programming.
me.promise = old_promise_method;
return me.promise.apply(me, arguments);
};
me.trigger.apply(me, args);
});
return;
}
if (canHandlePromise) {

@@ -631,3 +664,3 @@ var removeSuccess = me.completed.listen(function(args) {

return promise;
},
}
};

@@ -912,6 +945,8 @@

for (var k in definitions){
var val = definitions[k],
actionName = _.isObject(val) ? k : val;
if (definitions.hasOwnProperty(k)) {
var val = definitions[k],
actionName = _.isObject(val) ? k : val;
actions[actionName] = exports.createAction(val);
actions[actionName] = exports.createAction(val);
}
}

@@ -918,0 +953,0 @@ return actions;

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

!function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;"undefined"!=typeof window?b=window:"undefined"!=typeof global?b=global:"undefined"!=typeof self&&(b=self),b.Reflux=a()}}(function(){var a;return function b(a,c,d){function e(g,h){if(!c[g]){if(!a[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);throw new Error("Cannot find module '"+g+"'")}var j=c[g]={exports:{}};a[g][0].call(j.exports,function(b){var c=a[g][1][b];return e(c?c:b)},j,j.exports,b,a,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g<d.length;g++)e(d[g]);return e}({1:[function(a,b){"use strict";function c(a,b,c){this.fn=a,this.context=b,this.once=c||!1}function d(){}d.prototype._events=void 0,d.prototype.listeners=function(a){if(!this._events||!this._events[a])return[];for(var b=0,c=this._events[a].length,d=[];c>b;b++)d.push(this._events[a][b].fn);return d},d.prototype.emit=function(a,b,c,d,e,f){if(!this._events||!this._events[a])return!1;var g,h,i,j=this._events[a],k=j.length,l=arguments.length,m=j[0];if(1===k){switch(m.once&&this.removeListener(a,m.fn,!0),l){case 1:return m.fn.call(m.context),!0;case 2:return m.fn.call(m.context,b),!0;case 3:return m.fn.call(m.context,b,c),!0;case 4:return m.fn.call(m.context,b,c,d),!0;case 5:return m.fn.call(m.context,b,c,d,e),!0;case 6:return m.fn.call(m.context,b,c,d,e,f),!0}for(h=1,g=new Array(l-1);l>h;h++)g[h-1]=arguments[h];m.fn.apply(m.context,g)}else for(h=0;k>h;h++)switch(j[h].once&&this.removeListener(a,j[h].fn,!0),l){case 1:j[h].fn.call(j[h].context);break;case 2:j[h].fn.call(j[h].context,b);break;case 3:j[h].fn.call(j[h].context,b,c);break;default:if(!g)for(i=1,g=new Array(l-1);l>i;i++)g[i-1]=arguments[i];j[h].fn.apply(j[h].context,g)}return!0},d.prototype.on=function(a,b,d){return this._events||(this._events={}),this._events[a]||(this._events[a]=[]),this._events[a].push(new c(b,d||this)),this},d.prototype.once=function(a,b,d){return this._events||(this._events={}),this._events[a]||(this._events[a]=[]),this._events[a].push(new c(b,d||this,!0)),this},d.prototype.removeListener=function(a,b,c){if(!this._events||!this._events[a])return this;var d=this._events[a],e=[];if(b)for(var f=0,g=d.length;g>f;f++)d[f].fn!==b&&d[f].once!==c&&e.push(d[f]);return this._events[a]=e.length?e:null,this},d.prototype.removeAllListeners=function(a){return this._events?(a?this._events[a]=null:this._events={},this):this},d.prototype.off=d.prototype.removeListener,d.prototype.addListener=d.prototype.on,d.prototype.setMaxListeners=function(){return this},d.EventEmitter=d,d.EventEmitter2=d,d.EventEmitter3=d,"object"==typeof b&&b.exports&&(b.exports=d)},{}],2:[function(b,c){(function(b){!function(b,d,e){d[b]=d[b]||e(),"undefined"!=typeof c&&c.exports?c.exports=d[b]:"function"==typeof a&&a.amd&&a(function(){return d[b]})}("Promise","undefined"!=typeof b?b:this,function(){"use strict";function a(a,b){m.add(a,b),l||(l=o(m.drain))}function b(a){var b,c=typeof a;return null==a||"object"!=c&&"function"!=c||(b=a.then),"function"==typeof b?b:!1}function c(){for(var a=0;a<this.chain.length;a++)d(this,1===this.state?this.chain[a].success:this.chain[a].failure,this.chain[a]);this.chain.length=0}function d(a,c,d){var e,f;try{c===!1?d.reject(a.msg):(e=c===!0?a.msg:c.call(void 0,a.msg),e===d.promise?d.reject(TypeError("Promise-chain cycle")):(f=b(e))?f.call(e,d.resolve,d.reject):d.resolve(e))}catch(g){d.reject(g)}}function e(d){var g,i,j=this;if(!j.triggered){j.triggered=!0,j.def&&(j=j.def);try{(g=b(d))?(i=new h(j),g.call(d,function(){e.apply(i,arguments)},function(){f.apply(i,arguments)})):(j.msg=d,j.state=1,j.chain.length>0&&a(c,j))}catch(k){f.call(i||new h(j),k)}}}function f(b){var d=this;d.triggered||(d.triggered=!0,d.def&&(d=d.def),d.msg=b,d.state=2,d.chain.length>0&&a(c,d))}function g(a,b,c,d){for(var e=0;e<b.length;e++)!function(e){a.resolve(b[e]).then(function(a){c(e,a)},d)}(e)}function h(a){this.def=a,this.triggered=!1}function i(a){this.promise=a,this.state=0,this.triggered=!1,this.chain=[],this.msg=void 0}function j(b){if("function"!=typeof b)throw TypeError("Not a function");if(0!==this.__NPO__)throw TypeError("Not a promise");this.__NPO__=1;var d=new i(this);this.then=function(b,e){var f={success:"function"==typeof b?b:!0,failure:"function"==typeof e?e:!1};return f.promise=new this.constructor(function(a,b){if("function"!=typeof a||"function"!=typeof b)throw TypeError("Not a function");f.resolve=a,f.reject=b}),d.chain.push(f),0!==d.state&&a(c,d),f.promise},this["catch"]=function(a){return this.then(void 0,a)};try{b.call(void 0,function(a){e.call(d,a)},function(a){f.call(d,a)})}catch(g){f.call(d,g)}}var k,l,m,n=Object.prototype.toString,o="undefined"!=typeof setImmediate?function(a){return setImmediate(a)}:setTimeout;try{Object.defineProperty({},"x",{}),k=function(a,b,c,d){return Object.defineProperty(a,b,{value:c,writable:!0,configurable:d!==!1})}}catch(p){k=function(a,b,c){return a[b]=c,a}}m=function(){function a(a,b){this.fn=a,this.self=b,this.next=void 0}var b,c,d;return{add:function(e,f){d=new a(e,f),c?c.next=d:b=d,c=d,d=void 0},drain:function(){var a=b;for(b=c=l=void 0;a;)a.fn.call(a.self),a=a.next}}}();var q=k({},"constructor",j,!1);return k(j,"prototype",q,!1),k(q,"__NPO__",0,!1),k(j,"resolve",function(a){var b=this;return a&&"object"==typeof a&&1===a.__NPO__?a:new b(function(b,c){if("function"!=typeof b||"function"!=typeof c)throw TypeError("Not a function");b(a)})}),k(j,"reject",function(a){return new this(function(b,c){if("function"!=typeof b||"function"!=typeof c)throw TypeError("Not a function");c(a)})}),k(j,"all",function(a){var b=this;return"[object Array]"!=n.call(a)?b.reject(TypeError("Not an array")):0===a.length?b.resolve([]):new b(function(c,d){if("function"!=typeof c||"function"!=typeof d)throw TypeError("Not a function");var e=a.length,f=Array(e),h=0;g(b,a,function(a,b){f[a]=b,++h===e&&c(f)},d)})}),k(j,"race",function(a){var b=this;return"[object Array]"!=n.call(a)?b.reject(TypeError("Not an array")):new b(function(c,d){if("function"!=typeof c||"function"!=typeof d)throw TypeError("Not a function");g(b,a,function(a,b){c(b)},d)})}),j})}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],3:[function(a,b){b.exports={}},{}],4:[function(a,b,c){c.createdStores=[],c.createdActions=[],c.reset=function(){for(;c.createdStores.length;)c.createdStores.pop();for(;c.createdActions.length;)c.createdActions.pop()}},{}],5:[function(a,b){var c=a("./utils"),d=a("./joins").instanceJoinCreator,e=function(a){for(var b,c=0,d={};c<(a.children||[]).length;++c)b=a.children[c],a[b]&&(d[b]=a[b]);return d},f=function(a){var b={};for(var d in a){var g=a[d],h=e(g),i=f(h);b[d]=g;for(var j in i){var k=i[j];b[d+c.capitalize(j)]=k}}return b};b.exports={hasListener:function(a){for(var b,c,d,e=0;e<(this.subscriptions||[]).length;++e)for(d=[].concat(this.subscriptions[e].listenable),b=0;b<d.length;b++)if(c=d[b],c===a||c.hasListener&&c.hasListener(a))return!0;return!1},listenToMany:function(a){var b=f(a);for(var d in b){var e=c.callbackName(d),g=this[e]?e:this[d]?d:void 0;g&&this.listenTo(b[d],g,this[e+"Default"]||this[g+"Default"]||g)}},validateListening:function(a){return a===this?"Listener is not able to listen to itself":c.isFunction(a.listen)?a.hasListener&&a.hasListener(this)?"Listener cannot listen to this listenable because of circular loop":void 0:a+" is missing a listen method"},listenTo:function(a,b,d){var e,f,g,h=this.subscriptions=this.subscriptions||[];return c.throwIf(this.validateListening(a)),this.fetchInitialState(a,d),e=a.listen(this[b]||b,this),f=function(){var a=h.indexOf(g);c.throwIf(-1===a,"Tried to remove listen already gone from subscriptions list!"),h.splice(a,1),e()},g={stop:f,listenable:a},h.push(g),g},stopListeningTo:function(a){for(var b,d=0,e=this.subscriptions||[];d<e.length;d++)if(b=e[d],b.listenable===a)return b.stop(),c.throwIf(-1!==e.indexOf(b),"Failed to remove listen from subscriptions list!"),!0;return!1},stopListeningToAll:function(){for(var a,b=this.subscriptions||[];a=b.length;)b[0].stop(),c.throwIf(b.length!==a-1,"Failed to remove listen from subscriptions list!")},fetchInitialState:function(a,b){b=b&&this[b]||b;var d=this;if(c.isFunction(b)&&c.isFunction(a.getInitialState)){var e=a.getInitialState();e&&c.isFunction(e.then)?e.then(function(){b.apply(d,arguments)}):b.call(this,e)}},joinTrailing:d("last"),joinLeading:d("first"),joinConcat:d("all"),joinStrict:d("strict")}},{"./joins":15,"./utils":19}],6:[function(a,b){var c=a("./utils"),d=a("./ListenerMethods");b.exports=c.extend({componentWillUnmount:d.stopListeningToAll},d)},{"./ListenerMethods":5,"./utils":19}],7:[function(a,b){var c=a("./utils");b.exports={preEmit:function(){},shouldEmit:function(){return!0},listen:function(a,b){b=b||this;var c=function(c){a.apply(b,c)},d=this;return this.emitter.addListener(this.eventLabel,c),function(){d.emitter.removeListener(d.eventLabel,c)}},promise:function(a){var b=this,c=this.children.indexOf("completed")>=0&&this.children.indexOf("failed")>=0;if(!c)throw new Error('Publisher must have "completed" and "failed" child publishers');a.then(function(a){return b.completed(a)},function(a){return b.failed(a)})},listenAndPromise:function(a,b){var c=this;return b=b||this,this.listen(function(){if(!a)throw new Error("Expected a function returning a promise but got "+a);var d=arguments,e=a.apply(b,d);return c.promise.call(c,e)},b)},trigger:function(){var a=arguments,b=this.preEmit.apply(this,a);a=void 0===b?a:c.isArguments(b)?b:[].concat(b),this.shouldEmit.apply(this,a)&&this.emitter.emit(this.eventLabel,a)},triggerAsync:function(){var a=arguments,b=this;c.nextTick(function(){b.trigger.apply(b,a)})},triggerPromise:function(){var a=this,b=arguments,d=this.children.indexOf("completed")>=0&&this.children.indexOf("failed")>=0,e=c.createPromise(function(c,e){if(d)var f=a.completed.listen(function(a){f(),g(),c(a)}),g=a.failed.listen(function(a){f(),g(),e(a)});a.triggerAsync.apply(a,b),d||c()});return e}}},{"./utils":19}],8:[function(a,b){b.exports={}},{}],9:[function(a,b){b.exports=function(a,b){for(var c in b)if(Object.getOwnPropertyDescriptor&&Object.defineProperty){var d=Object.getOwnPropertyDescriptor(b,c);if(!d.value||"function"!=typeof d.value||!b.hasOwnProperty(c))continue;a[c]=b[c].bind(a)}else{var e=b[c];if("function"!=typeof e||!b.hasOwnProperty(c))continue;a[c]=e.bind(a)}return a}},{}],10:[function(a,b){var c=a("./index"),d=a("./utils");b.exports=function(a,b){return{getInitialState:function(){return d.isFunction(a.getInitialState)?void 0===b?a.getInitialState():d.object([b],[a.getInitialState()]):{}},componentDidMount:function(){d.extend(this,c.ListenerMethods);var e=this,f=void 0===b?this.setState:function(a){e.setState(d.object([b],[a]))};this.listenTo(a,f)},componentWillUnmount:c.ListenerMixin.componentWillUnmount}}},{"./index":14,"./utils":19}],11:[function(a,b){var c=a("./index"),d=a("./utils");b.exports=function(a,b,e){return e=d.isFunction(b)?b:e,{getInitialState:function(){if(d.isFunction(a.getInitialState)){if(d.isFunction(b))return e.call(this,a.getInitialState());var c=e.call(this,a.getInitialState());return c?d.object([b],[c]):{}}return{}},componentDidMount:function(){d.extend(this,c.ListenerMethods);var f=this,g=function(a){if(d.isFunction(b))f.setState(e.call(f,a));else{var c=e.call(f,a);f.setState(d.object([b],[c]))}};this.listenTo(a,g)},componentWillUnmount:c.ListenerMixin.componentWillUnmount}}},{"./index":14,"./utils":19}],12:[function(a,b){var c=a("./utils"),d=a("./index"),e=a("./Keep"),f={preEmit:1,shouldEmit:1},g=function(a){a=a||{},c.isObject(a)||(a={actionName:a});for(var b in d.ActionMethods)if(!f[b]&&d.PublisherMethods[b])throw new Error("Cannot override API method "+b+" in Reflux.ActionMethods. Use another method name or override it on Reflux.PublisherMethods instead.");for(var h in a)if(!f[h]&&d.PublisherMethods[h])throw new Error("Cannot override API method "+h+" in action creation. Use another method name or override it on Reflux.PublisherMethods instead.");a.children=a.children||[],a.asyncResult&&(a.children=a.children.concat(["completed","failed"]));for(var i=0,j={};i<a.children.length;i++){var k=a.children[i];j[k]=g(k)}var l=c.extend({eventLabel:"action",emitter:new c.EventEmitter,_isAction:!0},d.PublisherMethods,d.ActionMethods,a),m=function(){return m[m.sync?"trigger":"triggerPromise"].apply(m,arguments)};return c.extend(m,j,l),e.createdActions.push(m),m};b.exports=g},{"./Keep":4,"./index":14,"./utils":19}],13:[function(a,b){var c=a("./utils"),d=a("./index"),e=a("./Keep"),f=a("./mixer"),g={preEmit:1,shouldEmit:1},h=a("./bindMethods");b.exports=function(a){function b(){var b,d=0;if(this.subscriptions=[],this.emitter=new c.EventEmitter,this.eventLabel="change",h(this,a),this.init&&c.isFunction(this.init)&&this.init(),this.listenables)for(b=[].concat(this.listenables);d<b.length;d++)this.listenToMany(b[d])}a=a||{};for(var i in d.StoreMethods)if(!g[i]&&(d.PublisherMethods[i]||d.ListenerMethods[i]))throw new Error("Cannot override API method "+i+" in Reflux.StoreMethods. Use another method name or override it on Reflux.PublisherMethods / Reflux.ListenerMethods instead.");for(var j in a)if(!g[j]&&(d.PublisherMethods[j]||d.ListenerMethods[j]))throw new Error("Cannot override API method "+j+" in store creation. Use another method name or override it on Reflux.PublisherMethods / Reflux.ListenerMethods instead.");a=f(a),c.extend(b.prototype,d.ListenerMethods,d.PublisherMethods,d.StoreMethods,a);var k=new b;return e.createdStores.push(k),k}},{"./Keep":4,"./bindMethods":9,"./index":14,"./mixer":18,"./utils":19}],14:[function(a,b,c){c.ActionMethods=a("./ActionMethods"),c.ListenerMethods=a("./ListenerMethods"),c.PublisherMethods=a("./PublisherMethods"),c.StoreMethods=a("./StoreMethods"),c.createAction=a("./createAction"),c.createStore=a("./createStore"),c.connect=a("./connect"),c.connectFilter=a("./connectFilter"),c.ListenerMixin=a("./ListenerMixin"),c.listenTo=a("./listenTo"),c.listenToMany=a("./listenToMany");var d=a("./joins").staticJoinCreator;c.joinTrailing=c.all=d("last"),c.joinLeading=d("first"),c.joinStrict=d("strict"),c.joinConcat=d("all");var e=a("./utils");c.EventEmitter=e.EventEmitter,c.Promise=e.Promise,c.createActions=function(a){var b={};for(var d in a){var f=a[d],g=e.isObject(f)?d:f;b[g]=c.createAction(f)}return b},c.setEventEmitter=function(b){var d=a("./utils");c.EventEmitter=d.EventEmitter=b},c.setPromise=function(b){var d=a("./utils");c.Promise=d.Promise=b},c.setPromiseFactory=function(b){var c=a("./utils");c.createPromise=b},c.nextTick=function(b){var c=a("./utils");c.nextTick=b},c.__keep=a("./Keep"),Function.prototype.bind||console.error("Function.prototype.bind not available. ES5 shim required. https://github.com/spoike/refluxjs#es5")},{"./ActionMethods":3,"./Keep":4,"./ListenerMethods":5,"./ListenerMixin":6,"./PublisherMethods":7,"./StoreMethods":8,"./connect":10,"./connectFilter":11,"./createAction":12,"./createStore":13,"./joins":15,"./listenTo":16,"./listenToMany":17,"./utils":19}],15:[function(a,b,c){function d(a,b,c){return function(){var d,e=c.subscriptions,f=e?e.indexOf(a):-1;for(i.throwIf(-1===f,"Tried to remove join already gone from subscriptions list!"),d=0;d<b.length;d++)b[d]();e.splice(f,1)}}function e(a){a.listenablesEmitted=new Array(a.numberOfListenables),a.args=new Array(a.numberOfListenables)}function f(a,b){return function(){var c=h.call(arguments);if(b.listenablesEmitted[a])switch(b.strategy){case"strict":throw new Error("Strict join failed because listener triggered twice.");case"last":b.args[a]=c;break;case"all":b.args[a].push(c)}else b.listenablesEmitted[a]=!0,b.args[a]="all"===b.strategy?[c]:c;g(b)}}function g(a){for(var b=0;b<a.numberOfListenables;b++)if(!a.listenablesEmitted[b])return;a.callback.apply(a.listener,a.args),e(a)}var h=Array.prototype.slice,i=a("./utils"),j=a("./createStore"),k={strict:"joinStrict",first:"joinLeading",last:"joinTrailing",all:"joinConcat"};c.staticJoinCreator=function(a){return function(){var b=h.call(arguments);return j({init:function(){this[k[a]].apply(this,b.concat("triggerAsync"))}})}},c.instanceJoinCreator=function(a){return function(){i.throwIf(arguments.length<3,"Cannot create a join with less than 2 listenables!");var b,c,g=h.call(arguments),j=g.pop(),k=g.length,l={numberOfListenables:k,callback:this[j]||j,listener:this,strategy:a},m=[];for(b=0;k>b;b++)i.throwIf(this.validateListening(g[b]));for(b=0;k>b;b++)m.push(g[b].listen(f(b,l),this));return e(l),c={listenable:g},c.stop=d(c,m,this),this.subscriptions=(this.subscriptions||[]).concat(c),c}}},{"./createStore":13,"./utils":19}],16:[function(a,b){var c=a("./index");b.exports=function(a,b,d){return{componentDidMount:function(){for(var e in c.ListenerMethods)if(this[e]!==c.ListenerMethods[e]){if(this[e])throw"Can't have other property '"+e+"' when using Reflux.listenTo!";this[e]=c.ListenerMethods[e]}this.listenTo(a,b,d)},componentWillUnmount:c.ListenerMethods.stopListeningToAll}}},{"./index":14}],17:[function(a,b){var c=a("./index");b.exports=function(a){return{componentDidMount:function(){for(var b in c.ListenerMethods)if(this[b]!==c.ListenerMethods[b]){if(this[b])throw"Can't have other property '"+b+"' when using Reflux.listenToMany!";this[b]=c.ListenerMethods[b]}this.listenToMany(a)},componentWillUnmount:c.ListenerMethods.stopListeningToAll}}},{"./index":14}],18:[function(a,b){var c=a("./utils");b.exports=function(a){var b={init:[],preEmit:[],shouldEmit:[]},d=function e(a){var d={};return a.mixins&&a.mixins.forEach(function(a){c.extend(d,e(a))}),c.extend(d,a),Object.keys(b).forEach(function(c){a.hasOwnProperty(c)&&b[c].push(a[c])}),d}(a);return b.init.length>1&&(d.init=function(){var a=arguments;b.init.forEach(function(b){b.apply(this,a)},this)}),b.preEmit.length>1&&(d.preEmit=function(){return b.preEmit.reduce(function(a,b){var c=b.apply(this,a);return void 0===c?a:[c]}.bind(this),arguments)}),b.shouldEmit.length>1&&(d.shouldEmit=function(){var a=arguments;return!b.shouldEmit.some(function(b){return!b.apply(this,a)},this)}),Object.keys(b).forEach(function(a){1===b[a].length&&(d[a]=b[a][0])}),d}},{"./utils":19}],19:[function(a,b,c){var d=c.isObject=function(a){var b=typeof a;return"function"===b||"object"===b&&!!a};c.extend=function(a){if(!d(a))return a;for(var b,c,e=1,f=arguments.length;f>e;e++){b=arguments[e];for(c in b)if(Object.getOwnPropertyDescriptor&&Object.defineProperty){var g=Object.getOwnPropertyDescriptor(b,c);Object.defineProperty(a,c,g)}else a[c]=b[c]}return a},c.isFunction=function(a){return"function"==typeof a},c.EventEmitter=a("eventemitter3"),c.nextTick=function(a){setTimeout(a,0)},c.capitalize=function(a){return a.charAt(0).toUpperCase()+a.slice(1)},c.callbackName=function(a){return"on"+c.capitalize(a)},c.object=function(a,b){for(var c={},d=0;d<a.length;d++)c[a[d]]=b[d];return c},c.Promise=a("native-promise-only"),c.createPromise=function(a){return new c.Promise(a)},c.isArguments=function(a){return"object"==typeof a&&"callee"in a&&"number"==typeof a.length},c.throwIf=function(a,b){if(a)throw Error(b||a)}},{eventemitter3:1,"native-promise-only":2}]},{},[14])(14)});
!function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;"undefined"!=typeof window?b=window:"undefined"!=typeof global?b=global:"undefined"!=typeof self&&(b=self),b.Reflux=a()}}(function(){var a;return function b(a,c,d){function e(g,h){if(!c[g]){if(!a[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);throw new Error("Cannot find module '"+g+"'")}var j=c[g]={exports:{}};a[g][0].call(j.exports,function(b){var c=a[g][1][b];return e(c?c:b)},j,j.exports,b,a,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g<d.length;g++)e(d[g]);return e}({1:[function(a,b){"use strict";function c(a,b,c){this.fn=a,this.context=b,this.once=c||!1}function d(){}d.prototype._events=void 0,d.prototype.listeners=function(a){if(!this._events||!this._events[a])return[];for(var b=0,c=this._events[a].length,d=[];c>b;b++)d.push(this._events[a][b].fn);return d},d.prototype.emit=function(a,b,c,d,e,f){if(!this._events||!this._events[a])return!1;var g,h,i,j=this._events[a],k=j.length,l=arguments.length,m=j[0];if(1===k){switch(m.once&&this.removeListener(a,m.fn,!0),l){case 1:return m.fn.call(m.context),!0;case 2:return m.fn.call(m.context,b),!0;case 3:return m.fn.call(m.context,b,c),!0;case 4:return m.fn.call(m.context,b,c,d),!0;case 5:return m.fn.call(m.context,b,c,d,e),!0;case 6:return m.fn.call(m.context,b,c,d,e,f),!0}for(h=1,g=new Array(l-1);l>h;h++)g[h-1]=arguments[h];m.fn.apply(m.context,g)}else for(h=0;k>h;h++)switch(j[h].once&&this.removeListener(a,j[h].fn,!0),l){case 1:j[h].fn.call(j[h].context);break;case 2:j[h].fn.call(j[h].context,b);break;case 3:j[h].fn.call(j[h].context,b,c);break;default:if(!g)for(i=1,g=new Array(l-1);l>i;i++)g[i-1]=arguments[i];j[h].fn.apply(j[h].context,g)}return!0},d.prototype.on=function(a,b,d){return this._events||(this._events={}),this._events[a]||(this._events[a]=[]),this._events[a].push(new c(b,d||this)),this},d.prototype.once=function(a,b,d){return this._events||(this._events={}),this._events[a]||(this._events[a]=[]),this._events[a].push(new c(b,d||this,!0)),this},d.prototype.removeListener=function(a,b,c){if(!this._events||!this._events[a])return this;var d=this._events[a],e=[];if(b)for(var f=0,g=d.length;g>f;f++)d[f].fn!==b&&d[f].once!==c&&e.push(d[f]);return this._events[a]=e.length?e:null,this},d.prototype.removeAllListeners=function(a){return this._events?(a?this._events[a]=null:this._events={},this):this},d.prototype.off=d.prototype.removeListener,d.prototype.addListener=d.prototype.on,d.prototype.setMaxListeners=function(){return this},d.EventEmitter=d,d.EventEmitter2=d,d.EventEmitter3=d,"object"==typeof b&&b.exports&&(b.exports=d)},{}],2:[function(b,c){(function(b){!function(b,d,e){d[b]=d[b]||e(),"undefined"!=typeof c&&c.exports?c.exports=d[b]:"function"==typeof a&&a.amd&&a(function(){return d[b]})}("Promise","undefined"!=typeof b?b:this,function(){"use strict";function a(a,b){m.add(a,b),l||(l=o(m.drain))}function b(a){var b,c=typeof a;return null==a||"object"!=c&&"function"!=c||(b=a.then),"function"==typeof b?b:!1}function c(){for(var a=0;a<this.chain.length;a++)d(this,1===this.state?this.chain[a].success:this.chain[a].failure,this.chain[a]);this.chain.length=0}function d(a,c,d){var e,f;try{c===!1?d.reject(a.msg):(e=c===!0?a.msg:c.call(void 0,a.msg),e===d.promise?d.reject(TypeError("Promise-chain cycle")):(f=b(e))?f.call(e,d.resolve,d.reject):d.resolve(e))}catch(g){d.reject(g)}}function e(d){var g,i,j=this;if(!j.triggered){j.triggered=!0,j.def&&(j=j.def);try{(g=b(d))?(i=new h(j),g.call(d,function(){e.apply(i,arguments)},function(){f.apply(i,arguments)})):(j.msg=d,j.state=1,j.chain.length>0&&a(c,j))}catch(k){f.call(i||new h(j),k)}}}function f(b){var d=this;d.triggered||(d.triggered=!0,d.def&&(d=d.def),d.msg=b,d.state=2,d.chain.length>0&&a(c,d))}function g(a,b,c,d){for(var e=0;e<b.length;e++)!function(e){a.resolve(b[e]).then(function(a){c(e,a)},d)}(e)}function h(a){this.def=a,this.triggered=!1}function i(a){this.promise=a,this.state=0,this.triggered=!1,this.chain=[],this.msg=void 0}function j(b){if("function"!=typeof b)throw TypeError("Not a function");if(0!==this.__NPO__)throw TypeError("Not a promise");this.__NPO__=1;var d=new i(this);this.then=function(b,e){var f={success:"function"==typeof b?b:!0,failure:"function"==typeof e?e:!1};return f.promise=new this.constructor(function(a,b){if("function"!=typeof a||"function"!=typeof b)throw TypeError("Not a function");f.resolve=a,f.reject=b}),d.chain.push(f),0!==d.state&&a(c,d),f.promise},this["catch"]=function(a){return this.then(void 0,a)};try{b.call(void 0,function(a){e.call(d,a)},function(a){f.call(d,a)})}catch(g){f.call(d,g)}}var k,l,m,n=Object.prototype.toString,o="undefined"!=typeof setImmediate?function(a){return setImmediate(a)}:setTimeout;try{Object.defineProperty({},"x",{}),k=function(a,b,c,d){return Object.defineProperty(a,b,{value:c,writable:!0,configurable:d!==!1})}}catch(p){k=function(a,b,c){return a[b]=c,a}}m=function(){function a(a,b){this.fn=a,this.self=b,this.next=void 0}var b,c,d;return{add:function(e,f){d=new a(e,f),c?c.next=d:b=d,c=d,d=void 0},drain:function(){var a=b;for(b=c=l=void 0;a;)a.fn.call(a.self),a=a.next}}}();var q=k({},"constructor",j,!1);return k(j,"prototype",q,!1),k(q,"__NPO__",0,!1),k(j,"resolve",function(a){var b=this;return a&&"object"==typeof a&&1===a.__NPO__?a:new b(function(b,c){if("function"!=typeof b||"function"!=typeof c)throw TypeError("Not a function");b(a)})}),k(j,"reject",function(a){return new this(function(b,c){if("function"!=typeof b||"function"!=typeof c)throw TypeError("Not a function");c(a)})}),k(j,"all",function(a){var b=this;return"[object Array]"!=n.call(a)?b.reject(TypeError("Not an array")):0===a.length?b.resolve([]):new b(function(c,d){if("function"!=typeof c||"function"!=typeof d)throw TypeError("Not a function");var e=a.length,f=Array(e),h=0;g(b,a,function(a,b){f[a]=b,++h===e&&c(f)},d)})}),k(j,"race",function(a){var b=this;return"[object Array]"!=n.call(a)?b.reject(TypeError("Not an array")):new b(function(c,d){if("function"!=typeof c||"function"!=typeof d)throw TypeError("Not a function");g(b,a,function(a,b){c(b)},d)})}),j})}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],3:[function(a,b){b.exports={}},{}],4:[function(a,b,c){c.createdStores=[],c.createdActions=[],c.reset=function(){for(;c.createdStores.length;)c.createdStores.pop();for(;c.createdActions.length;)c.createdActions.pop()}},{}],5:[function(a,b){var c=a("./utils"),d=a("./joins").instanceJoinCreator,e=function(a){for(var b,c=0,d={};c<(a.children||[]).length;++c)b=a.children[c],a[b]&&(d[b]=a[b]);return d},f=function(a){var b={};for(var d in a){var g=a[d],h=e(g),i=f(h);b[d]=g;for(var j in i){var k=i[j];b[d+c.capitalize(j)]=k}}return b};b.exports={hasListener:function(a){for(var b,c,d,e=0;e<(this.subscriptions||[]).length;++e)for(d=[].concat(this.subscriptions[e].listenable),b=0;b<d.length;b++)if(c=d[b],c===a||c.hasListener&&c.hasListener(a))return!0;return!1},listenToMany:function(a){var b=f(a);for(var d in b){var e=c.callbackName(d),g=this[e]?e:this[d]?d:void 0;g&&this.listenTo(b[d],g,this[e+"Default"]||this[g+"Default"]||g)}},validateListening:function(a){return a===this?"Listener is not able to listen to itself":c.isFunction(a.listen)?a.hasListener&&a.hasListener(this)?"Listener cannot listen to this listenable because of circular loop":void 0:a+" is missing a listen method"},listenTo:function(a,b,d){var e,f,g,h=this.subscriptions=this.subscriptions||[];return c.throwIf(this.validateListening(a)),this.fetchInitialState(a,d),e=a.listen(this[b]||b,this),f=function(){var a=h.indexOf(g);c.throwIf(-1===a,"Tried to remove listen already gone from subscriptions list!"),h.splice(a,1),e()},g={stop:f,listenable:a},h.push(g),g},stopListeningTo:function(a){for(var b,d=0,e=this.subscriptions||[];d<e.length;d++)if(b=e[d],b.listenable===a)return b.stop(),c.throwIf(-1!==e.indexOf(b),"Failed to remove listen from subscriptions list!"),!0;return!1},stopListeningToAll:function(){for(var a,b=this.subscriptions||[];a=b.length;)b[0].stop(),c.throwIf(b.length!==a-1,"Failed to remove listen from subscriptions list!")},fetchInitialState:function(a,b){b=b&&this[b]||b;var d=this;if(c.isFunction(b)&&c.isFunction(a.getInitialState)){var e=a.getInitialState();e&&c.isFunction(e.then)?e.then(function(){b.apply(d,arguments)}):b.call(this,e)}},joinTrailing:d("last"),joinLeading:d("first"),joinConcat:d("all"),joinStrict:d("strict")}},{"./joins":15,"./utils":19}],6:[function(a,b){var c=a("./utils"),d=a("./ListenerMethods");b.exports=c.extend({componentWillUnmount:d.stopListeningToAll},d)},{"./ListenerMethods":5,"./utils":19}],7:[function(a,b){var c=a("./utils");b.exports={preEmit:function(){},shouldEmit:function(){return!0},listen:function(a,b){b=b||this;var c=function(c){e||a.apply(b,c)},d=this,e=!1;return this.emitter.addListener(this.eventLabel,c),function(){e=!0,d.emitter.removeListener(d.eventLabel,c)}},promise:function(a){var b=this,c=this.children.indexOf("completed")>=0&&this.children.indexOf("failed")>=0;if(!c)throw new Error('Publisher must have "completed" and "failed" child publishers');a.then(function(a){return b.completed(a)},function(a){return b.failed(a)})},listenAndPromise:function(a,b){var c=this;b=b||this,this.willCallPromise=(this.willCallPromise||0)+1;var d=this.listen(function(){if(!a)throw new Error("Expected a function returning a promise but got "+a);var d=arguments,e=a.apply(b,d);return c.promise.call(c,e)},b);return function(){c.willCallPromise--,d.call(c)}},trigger:function(){var a=arguments,b=this.preEmit.apply(this,a);a=void 0===b?a:c.isArguments(b)?b:[].concat(b),this.shouldEmit.apply(this,a)&&this.emitter.emit(this.eventLabel,a)},triggerAsync:function(){var a=arguments,b=this;c.nextTick(function(){b.trigger.apply(b,a)})},triggerPromise:function(){var a=this,b=arguments,d=this.children.indexOf("completed")>=0&&this.children.indexOf("failed")>=0,e=c.createPromise(function(e,f){if(a.willCallPromise)return void c.nextTick(function(){var c=a.promise;a.promise=function(b){return b.then(e,f),a.promise=c,a.promise.apply(a,arguments)},a.trigger.apply(a,b)});if(d)var g=a.completed.listen(function(a){g(),h(),e(a)}),h=a.failed.listen(function(a){g(),h(),f(a)});a.triggerAsync.apply(a,b),d||e()});return e}}},{"./utils":19}],8:[function(a,b){b.exports={}},{}],9:[function(a,b){b.exports=function(a,b){for(var c in b)if(Object.getOwnPropertyDescriptor&&Object.defineProperty){var d=Object.getOwnPropertyDescriptor(b,c);if(!d.value||"function"!=typeof d.value||!b.hasOwnProperty(c))continue;a[c]=b[c].bind(a)}else{var e=b[c];if("function"!=typeof e||!b.hasOwnProperty(c))continue;a[c]=e.bind(a)}return a}},{}],10:[function(a,b){var c=a("./index"),d=a("./utils");b.exports=function(a,b){return{getInitialState:function(){return d.isFunction(a.getInitialState)?void 0===b?a.getInitialState():d.object([b],[a.getInitialState()]):{}},componentDidMount:function(){d.extend(this,c.ListenerMethods);var e=this,f=void 0===b?this.setState:function(a){e.setState(d.object([b],[a]))};this.listenTo(a,f)},componentWillUnmount:c.ListenerMixin.componentWillUnmount}}},{"./index":14,"./utils":19}],11:[function(a,b){var c=a("./index"),d=a("./utils");b.exports=function(a,b,e){return e=d.isFunction(b)?b:e,{getInitialState:function(){if(d.isFunction(a.getInitialState)){if(d.isFunction(b))return e.call(this,a.getInitialState());var c=e.call(this,a.getInitialState());return c?d.object([b],[c]):{}}return{}},componentDidMount:function(){d.extend(this,c.ListenerMethods);var f=this,g=function(a){if(d.isFunction(b))f.setState(e.call(f,a));else{var c=e.call(f,a);f.setState(d.object([b],[c]))}};this.listenTo(a,g)},componentWillUnmount:c.ListenerMixin.componentWillUnmount}}},{"./index":14,"./utils":19}],12:[function(a,b){var c=a("./utils"),d=a("./index"),e=a("./Keep"),f={preEmit:1,shouldEmit:1},g=function(a){a=a||{},c.isObject(a)||(a={actionName:a});for(var b in d.ActionMethods)if(!f[b]&&d.PublisherMethods[b])throw new Error("Cannot override API method "+b+" in Reflux.ActionMethods. Use another method name or override it on Reflux.PublisherMethods instead.");for(var h in a)if(!f[h]&&d.PublisherMethods[h])throw new Error("Cannot override API method "+h+" in action creation. Use another method name or override it on Reflux.PublisherMethods instead.");a.children=a.children||[],a.asyncResult&&(a.children=a.children.concat(["completed","failed"]));for(var i=0,j={};i<a.children.length;i++){var k=a.children[i];j[k]=g(k)}var l=c.extend({eventLabel:"action",emitter:new c.EventEmitter,_isAction:!0},d.PublisherMethods,d.ActionMethods,a),m=function(){return m[m.sync?"trigger":"triggerPromise"].apply(m,arguments)};return c.extend(m,j,l),e.createdActions.push(m),m};b.exports=g},{"./Keep":4,"./index":14,"./utils":19}],13:[function(a,b){var c=a("./utils"),d=a("./index"),e=a("./Keep"),f=a("./mixer"),g={preEmit:1,shouldEmit:1},h=a("./bindMethods");b.exports=function(a){function b(){var b,d=0;if(this.subscriptions=[],this.emitter=new c.EventEmitter,this.eventLabel="change",h(this,a),this.init&&c.isFunction(this.init)&&this.init(),this.listenables)for(b=[].concat(this.listenables);d<b.length;d++)this.listenToMany(b[d])}a=a||{};for(var i in d.StoreMethods)if(!g[i]&&(d.PublisherMethods[i]||d.ListenerMethods[i]))throw new Error("Cannot override API method "+i+" in Reflux.StoreMethods. Use another method name or override it on Reflux.PublisherMethods / Reflux.ListenerMethods instead.");for(var j in a)if(!g[j]&&(d.PublisherMethods[j]||d.ListenerMethods[j]))throw new Error("Cannot override API method "+j+" in store creation. Use another method name or override it on Reflux.PublisherMethods / Reflux.ListenerMethods instead.");a=f(a),c.extend(b.prototype,d.ListenerMethods,d.PublisherMethods,d.StoreMethods,a);var k=new b;return e.createdStores.push(k),k}},{"./Keep":4,"./bindMethods":9,"./index":14,"./mixer":18,"./utils":19}],14:[function(a,b,c){c.ActionMethods=a("./ActionMethods"),c.ListenerMethods=a("./ListenerMethods"),c.PublisherMethods=a("./PublisherMethods"),c.StoreMethods=a("./StoreMethods"),c.createAction=a("./createAction"),c.createStore=a("./createStore"),c.connect=a("./connect"),c.connectFilter=a("./connectFilter"),c.ListenerMixin=a("./ListenerMixin"),c.listenTo=a("./listenTo"),c.listenToMany=a("./listenToMany");var d=a("./joins").staticJoinCreator;c.joinTrailing=c.all=d("last"),c.joinLeading=d("first"),c.joinStrict=d("strict"),c.joinConcat=d("all");var e=a("./utils");c.EventEmitter=e.EventEmitter,c.Promise=e.Promise,c.createActions=function(a){var b={};for(var d in a)if(a.hasOwnProperty(d)){var f=a[d],g=e.isObject(f)?d:f;b[g]=c.createAction(f)}return b},c.setEventEmitter=function(b){var d=a("./utils");c.EventEmitter=d.EventEmitter=b},c.setPromise=function(b){var d=a("./utils");c.Promise=d.Promise=b},c.setPromiseFactory=function(b){var c=a("./utils");c.createPromise=b},c.nextTick=function(b){var c=a("./utils");c.nextTick=b},c.__keep=a("./Keep"),Function.prototype.bind||console.error("Function.prototype.bind not available. ES5 shim required. https://github.com/spoike/refluxjs#es5")},{"./ActionMethods":3,"./Keep":4,"./ListenerMethods":5,"./ListenerMixin":6,"./PublisherMethods":7,"./StoreMethods":8,"./connect":10,"./connectFilter":11,"./createAction":12,"./createStore":13,"./joins":15,"./listenTo":16,"./listenToMany":17,"./utils":19}],15:[function(a,b,c){function d(a,b,c){return function(){var d,e=c.subscriptions,f=e?e.indexOf(a):-1;for(i.throwIf(-1===f,"Tried to remove join already gone from subscriptions list!"),d=0;d<b.length;d++)b[d]();e.splice(f,1)}}function e(a){a.listenablesEmitted=new Array(a.numberOfListenables),a.args=new Array(a.numberOfListenables)}function f(a,b){return function(){var c=h.call(arguments);if(b.listenablesEmitted[a])switch(b.strategy){case"strict":throw new Error("Strict join failed because listener triggered twice.");case"last":b.args[a]=c;break;case"all":b.args[a].push(c)}else b.listenablesEmitted[a]=!0,b.args[a]="all"===b.strategy?[c]:c;g(b)}}function g(a){for(var b=0;b<a.numberOfListenables;b++)if(!a.listenablesEmitted[b])return;a.callback.apply(a.listener,a.args),e(a)}var h=Array.prototype.slice,i=a("./utils"),j=a("./createStore"),k={strict:"joinStrict",first:"joinLeading",last:"joinTrailing",all:"joinConcat"};c.staticJoinCreator=function(a){return function(){var b=h.call(arguments);return j({init:function(){this[k[a]].apply(this,b.concat("triggerAsync"))}})}},c.instanceJoinCreator=function(a){return function(){i.throwIf(arguments.length<3,"Cannot create a join with less than 2 listenables!");var b,c,g=h.call(arguments),j=g.pop(),k=g.length,l={numberOfListenables:k,callback:this[j]||j,listener:this,strategy:a},m=[];for(b=0;k>b;b++)i.throwIf(this.validateListening(g[b]));for(b=0;k>b;b++)m.push(g[b].listen(f(b,l),this));return e(l),c={listenable:g},c.stop=d(c,m,this),this.subscriptions=(this.subscriptions||[]).concat(c),c}}},{"./createStore":13,"./utils":19}],16:[function(a,b){var c=a("./index");b.exports=function(a,b,d){return{componentDidMount:function(){for(var e in c.ListenerMethods)if(this[e]!==c.ListenerMethods[e]){if(this[e])throw"Can't have other property '"+e+"' when using Reflux.listenTo!";this[e]=c.ListenerMethods[e]}this.listenTo(a,b,d)},componentWillUnmount:c.ListenerMethods.stopListeningToAll}}},{"./index":14}],17:[function(a,b){var c=a("./index");b.exports=function(a){return{componentDidMount:function(){for(var b in c.ListenerMethods)if(this[b]!==c.ListenerMethods[b]){if(this[b])throw"Can't have other property '"+b+"' when using Reflux.listenToMany!";this[b]=c.ListenerMethods[b]}this.listenToMany(a)},componentWillUnmount:c.ListenerMethods.stopListeningToAll}}},{"./index":14}],18:[function(a,b){var c=a("./utils");b.exports=function(a){var b={init:[],preEmit:[],shouldEmit:[]},d=function e(a){var d={};return a.mixins&&a.mixins.forEach(function(a){c.extend(d,e(a))}),c.extend(d,a),Object.keys(b).forEach(function(c){a.hasOwnProperty(c)&&b[c].push(a[c])}),d}(a);return b.init.length>1&&(d.init=function(){var a=arguments;b.init.forEach(function(b){b.apply(this,a)},this)}),b.preEmit.length>1&&(d.preEmit=function(){return b.preEmit.reduce(function(a,b){var c=b.apply(this,a);return void 0===c?a:[c]}.bind(this),arguments)}),b.shouldEmit.length>1&&(d.shouldEmit=function(){var a=arguments;return!b.shouldEmit.some(function(b){return!b.apply(this,a)},this)}),Object.keys(b).forEach(function(a){1===b[a].length&&(d[a]=b[a][0])}),d}},{"./utils":19}],19:[function(a,b,c){var d=c.isObject=function(a){var b=typeof a;return"function"===b||"object"===b&&!!a};c.extend=function(a){if(!d(a))return a;for(var b,c,e=1,f=arguments.length;f>e;e++){b=arguments[e];for(c in b)if(Object.getOwnPropertyDescriptor&&Object.defineProperty){var g=Object.getOwnPropertyDescriptor(b,c);Object.defineProperty(a,c,g)}else a[c]=b[c]}return a},c.isFunction=function(a){return"function"==typeof a},c.EventEmitter=a("eventemitter3"),c.nextTick=function(a){setTimeout(a,0)},c.capitalize=function(a){return a.charAt(0).toUpperCase()+a.slice(1)},c.callbackName=function(a){return"on"+c.capitalize(a)},c.object=function(a,b){for(var c={},d=0;d<a.length;d++)c[a[d]]=b[d];return c},c.Promise=a("native-promise-only"),c.createPromise=function(a){return new c.Promise(a)},c.isArguments=function(a){return"object"==typeof a&&"callee"in a&&"number"==typeof a.length},c.throwIf=function(a,b){if(a)throw Error(b||a)}},{eventemitter3:1,"native-promise-only":2}]},{},[14])(14)});
{
"name": "reflux",
"version": "0.2.6",
"version": "0.2.7",
"description": "A simple library for uni-directional dataflow application architecture inspired by ReactJS Flux",

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

@@ -49,6 +49,8 @@ exports.ActionMethods = require('./ActionMethods');

for (var k in definitions){
var val = definitions[k],
actionName = _.isObject(val) ? k : val;
if (definitions.hasOwnProperty(k)) {
var val = definitions[k],
actionName = _.isObject(val) ? k : val;
actions[actionName] = exports.createAction(val);
actions[actionName] = exports.createAction(val);
}
}

@@ -55,0 +57,0 @@ return actions;

@@ -37,6 +37,10 @@ var _ = require('./utils');

var eventHandler = function(args) {
if (aborted){
return;
}
callback.apply(bindContext, args);
}, me = this;
}, me = this, aborted = false;
this.emitter.addListener(this.eventLabel, eventHandler);
return function() {
aborted = true;
me.emitter.removeListener(me.eventLabel, eventHandler);

@@ -79,4 +83,5 @@ };

bindContext = bindContext || this;
this.willCallPromise = (this.willCallPromise || 0) + 1;
return this.listen(function() {
var removeListen = this.listen(function() {

@@ -91,2 +96,8 @@ if (!callback) {

}, bindContext);
return function () {
me.willCallPromise--;
removeListen.call(me);
};
},

@@ -118,2 +129,8 @@

* Returns a Promise for the triggered action
*
* @return {Promise}
* Resolved by completed child action.
* Rejected by failed child action.
* If listenAndPromise'd, then promise associated to this trigger.
* Otherwise, the promise is for next child action completion.
*/

@@ -129,2 +146,18 @@ triggerPromise: function(){

var promise = _.createPromise(function(resolve, reject) {
// If `listenAndPromise` is listening
// patch `promise` w/ context-loaded resolve/reject
if (me.willCallPromise) {
_.nextTick(function() {
var old_promise_method = me.promise;
me.promise = function (promise) {
promise.then(resolve, reject);
// Back to your regularly schedule programming.
me.promise = old_promise_method;
return me.promise.apply(me, arguments);
};
me.trigger.apply(me, args);
});
return;
}
if (canHandlePromise) {

@@ -152,3 +185,3 @@ var removeSuccess = me.completed.listen(function(args) {

return promise;
},
}
};
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