hippodrome 0.0.23 → 0.0.24

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c51b7923c28bee3173cf828b35281aefad0db540
4
- data.tar.gz: 193cfcf497858f1ac98e06e8f0206aeaedc92c64
3
+ metadata.gz: 978fbc039b45352d86b23dfe98e7625418cf316a
4
+ data.tar.gz: 0939c65848ef70ef1d84cdb0c9bf5374d3459e6f
5
5
  SHA512:
6
- metadata.gz: 2e11e176625a96688171636e54dbaf7d81c225522fa3fea80e28a17646034c6dafb9913305377e5fbb0f53517114004c76ce499d0535fb0c214d5dc7de8e5c48
7
- data.tar.gz: efc1ab3c30daac46c3f7c44c8483940712be2fe1d2277b2c8a9c58a93cbf32efb8fd44570f9f61b049cb19c4ea33634cfa403c25d27d01c8e898acdb8f2d8349
6
+ metadata.gz: 462d65c404dc55118ce3eb795fae3089327919177766edd9783142fbb7d1ce1a1dcf373022101f0d8db0ea75f829afc9e53036d713ba5f91e27fda12aac692b6
7
+ data.tar.gz: 8297b6ce39ca69904bfc76e07c678a4c8f7a33f36b2780085d5fd347127c09b3cd713cf1d1b65d7aca8c455eb9b23e776f7ac453872bd139cc56c569bbea44b4
@@ -188,7 +188,13 @@
188
188
  };
189
189
 
190
190
  Store = function(options) {
191
- this._storeImpl = {};
191
+ this._storeImpl = {
192
+ trigger: function() {
193
+ return _.each(this.callbacks, function(callback) {
194
+ return callback();
195
+ });
196
+ }
197
+ };
192
198
  this._storeImpl.dispatcherIdsByAction = {};
193
199
  this._storeImpl.callbacks = [];
194
200
  _.assign(this._storeImpl, _.omit(options, 'initialize', 'dispatches', 'public'), bindToContextIfFunction(this._storeImpl));
@@ -242,9 +248,7 @@
242
248
  };
243
249
 
244
250
  Store.prototype.trigger = function() {
245
- return _.forEach(this._storeImpl.callbacks, function(callback) {
246
- return callback();
247
- });
251
+ return this._storeImpl.trigger();
248
252
  };
249
253
 
250
254
  Hippodrome.Store = Store;
@@ -1,3 +1,3 @@
1
1
  //= require lodash
2
2
 
3
- (function(){var t,i,s,r,n,e,a,o,c,l,p,u,h=[].slice;p="undefined"==typeof window,u=p?require("lodash"):this._,r={},o=function(){var t,i,s,r,n;if(s=arguments[0],n=arguments[1],i=3<=arguments.length?h.call(arguments,2):[],!s)throw t=0,r=new Error("Assertion Failed: "+n.replace(/%s/g,function(){return i[t++]})),r.framesToPop=1,r;return s},n=function(t){return this._lastId=1,this._prefix=t},n.prototype.next=function(){return""+this._prefix+"_"+this._lastId++},a=new n("Action_ID"),t=function(t,i){var s,n,e,o;return e=""+a.next()+"_"+t,n=function(){var t;return t=i.apply(null,arguments),t.action=e,t},o=function(t){return r.Dispatcher.dispatch(t)},s=function(){var t;return t=n.apply(null,arguments),o(t)},s.buildPayload=n,s.send=o,s.displayName=t,s.id=e,s.toString=function(){return e},s},r.Action=t,s=function(){return this._callbacksByAction={},this._isStarted={},this._isFinished={},this._isDispatching=!1,this._payload=null},l=new n("Dispatcher_ID"),s.prototype.register=function(){var t,i,s,r,n,e,a;return i=u.compact(arguments),3===i.length?this.register(i[0],i[1],[],i[2]):(e=i[0],t=i[1],n=i[2],s=i[3],null==(a=this._callbacksByAction)[t]&&(a[t]={}),r=l.next(),this._callbacksByAction[t][r]={callback:s,prerequisites:u.map(n,function(i){return i._storeImpl.dispatcherIdsByAction[t]})},r)},s.prototype.unregister=function(t,i){return o(this._callbacksByAction[t][i],"Dispatcher.unregister(%s, %s) does not map to a registered callback.",t.displayName,i),this._callbacksByAction[t][i]=null},s.prototype.waitFor=function(t,i){return o(this._isDispatching,"Dispatcher.waitFor must be invoked while dispatching."),u.forEach(i,function(i){return function(s){return i._isStarted[s]?void o(i._isFinished[s],"Dispatcher.waitFor encountered circular dependency while waiting for `%s` during %s.",s,t.displayName):(o(i._callbacksByAction[t][s],"Dispatcher.waitFor `%s` is not a registered callback for %s.",s,t.displayName),i.invokeCallback(t,s))}}(this))},s.prototype.dispatch=function(t){var i;o(!this._isDispatching,"Dispatch.dispatch cannot be called during dispatch."),this.startDispatching(t);try{return i=t.action,u.forEach(this._callbacksByAction[i],function(t){return function(s,r){return t._isStarted[r]?void 0:t.invokeCallback(i,r)}}(this))}finally{this.stopDispatching()}},s.prototype.invokeCallback=function(t,i){var s,r,n;return this._isStarted[i]=!0,n=this._callbacksByAction[t][i],s=n.callback,r=n.prerequisites,this.waitFor(t,r),s(this._payload),this._isFinished[i]=!0},s.prototype.startDispatching=function(t){return this._isStarted={},this._isFinished={},this._payload=t,this._isDispatching=!0},s.prototype.stopDispatching=function(){return this._payload=null,this._isDispatching=!1},r.Dispatcher=new s,i=function(t){var i,s,n;return o(t.action,"DeferredTask must register for exactly one action."),o(t.task,"DeferredTask must supply exactly one task to run"),i=t.action,n=t.task,"string"==typeof n&&(n=this[n]),n=u.defer.bind(this,n),s=r.Dispatcher.register(this,i.id,[],n),this._dispatcherIdsByAction={},this._dispatcherIdsByAction[i.id]=s,this},r.DeferredTask=i,c=function(t){return function(i,s){return s instanceof Function?s.bind(t):s}},e=function(t){return this._storeImpl={},this._storeImpl.dispatcherIdsByAction={},this._storeImpl.callbacks=[],u.assign(this._storeImpl,u.omit(t,"initialize","dispatches","public"),c(this._storeImpl)),t["public"]&&(u.assign(this,t["public"],c(this._storeImpl)),u.assign(this._storeImpl,t["public"],c(this._storeImpl))),this.displayName=t.displayName,t.initialize&&t.initialize.call(this._storeImpl),t.dispatches&&u.forEach(t.dispatches,function(t){return function(i){var s,n,e,a;return s=i.action,n=i.after,e=i.callback,o(!t._storeImpl.dispatcherIdsByAction[s.id],"Store "+t.displayName+" registered two callbacks for action "+s.displayName),"string"==typeof e&&(e=t._storeImpl[e]),e=e.bind(t._storeImpl),a=r.Dispatcher.register(t,s.id,n,e),t._storeImpl.dispatcherIdsByAction[s.id]=a}}(this)),this},e.prototype.register=function(t){return this._storeImpl.callbacks.push(t)},e.prototype.unregister=function(t){return this._storeImpl.callbacks=u.reject(this._storeImpl.callbacks,function(i){return i===t})},e.prototype.listen=function(t){var i;return i=this,{componentDidMount:function(){return i.register(this[t])},componentWillUnmount:function(){return i.unregister(this[t])}}},e.prototype.trigger=function(){return u.forEach(this._storeImpl.callbacks,function(t){return t()})},r.Store=e,p?module.exports=r:this.Hippodrome=r}).call(this);
3
+ (function(){var t,i,s,r,n,e,a,o,c,l,p,u,h=[].slice;p="undefined"==typeof window,u=p?require("lodash"):this._,r={},o=function(){var t,i,s,r,n;if(s=arguments[0],n=arguments[1],i=3<=arguments.length?h.call(arguments,2):[],!s)throw t=0,r=new Error("Assertion Failed: "+n.replace(/%s/g,function(){return i[t++]})),r.framesToPop=1,r;return s},n=function(t){return this._lastId=1,this._prefix=t},n.prototype.next=function(){return""+this._prefix+"_"+this._lastId++},a=new n("Action_ID"),t=function(t,i){var s,n,e,o;return e=""+a.next()+"_"+t,n=function(){var t;return t=i.apply(null,arguments),t.action=e,t},o=function(t){return r.Dispatcher.dispatch(t)},s=function(){var t;return t=n.apply(null,arguments),o(t)},s.buildPayload=n,s.send=o,s.displayName=t,s.id=e,s.toString=function(){return e},s},r.Action=t,s=function(){return this._callbacksByAction={},this._isStarted={},this._isFinished={},this._isDispatching=!1,this._payload=null},l=new n("Dispatcher_ID"),s.prototype.register=function(){var t,i,s,r,n,e,a;return i=u.compact(arguments),3===i.length?this.register(i[0],i[1],[],i[2]):(e=i[0],t=i[1],n=i[2],s=i[3],null==(a=this._callbacksByAction)[t]&&(a[t]={}),r=l.next(),this._callbacksByAction[t][r]={callback:s,prerequisites:u.map(n,function(i){return i._storeImpl.dispatcherIdsByAction[t]})},r)},s.prototype.unregister=function(t,i){return o(this._callbacksByAction[t][i],"Dispatcher.unregister(%s, %s) does not map to a registered callback.",t.displayName,i),this._callbacksByAction[t][i]=null},s.prototype.waitFor=function(t,i){return o(this._isDispatching,"Dispatcher.waitFor must be invoked while dispatching."),u.forEach(i,function(i){return function(s){return i._isStarted[s]?void o(i._isFinished[s],"Dispatcher.waitFor encountered circular dependency while waiting for `%s` during %s.",s,t.displayName):(o(i._callbacksByAction[t][s],"Dispatcher.waitFor `%s` is not a registered callback for %s.",s,t.displayName),i.invokeCallback(t,s))}}(this))},s.prototype.dispatch=function(t){var i;o(!this._isDispatching,"Dispatch.dispatch cannot be called during dispatch."),this.startDispatching(t);try{return i=t.action,u.forEach(this._callbacksByAction[i],function(t){return function(s,r){return t._isStarted[r]?void 0:t.invokeCallback(i,r)}}(this))}finally{this.stopDispatching()}},s.prototype.invokeCallback=function(t,i){var s,r,n;return this._isStarted[i]=!0,n=this._callbacksByAction[t][i],s=n.callback,r=n.prerequisites,this.waitFor(t,r),s(this._payload),this._isFinished[i]=!0},s.prototype.startDispatching=function(t){return this._isStarted={},this._isFinished={},this._payload=t,this._isDispatching=!0},s.prototype.stopDispatching=function(){return this._payload=null,this._isDispatching=!1},r.Dispatcher=new s,i=function(t){var i,s,n;return o(t.action,"DeferredTask must register for exactly one action."),o(t.task,"DeferredTask must supply exactly one task to run"),i=t.action,n=t.task,"string"==typeof n&&(n=this[n]),n=u.defer.bind(this,n),s=r.Dispatcher.register(this,i.id,[],n),this._dispatcherIdsByAction={},this._dispatcherIdsByAction[i.id]=s,this},r.DeferredTask=i,c=function(t){return function(i,s){return s instanceof Function?s.bind(t):s}},e=function(t){return this._storeImpl={trigger:function(){return u.each(this.callbacks,function(t){return t()})}},this._storeImpl.dispatcherIdsByAction={},this._storeImpl.callbacks=[],u.assign(this._storeImpl,u.omit(t,"initialize","dispatches","public"),c(this._storeImpl)),t["public"]&&(u.assign(this,t["public"],c(this._storeImpl)),u.assign(this._storeImpl,t["public"],c(this._storeImpl))),this.displayName=t.displayName,t.initialize&&t.initialize.call(this._storeImpl),t.dispatches&&u.forEach(t.dispatches,function(t){return function(i){var s,n,e,a;return s=i.action,n=i.after,e=i.callback,o(!t._storeImpl.dispatcherIdsByAction[s.id],"Store "+t.displayName+" registered two callbacks for action "+s.displayName),"string"==typeof e&&(e=t._storeImpl[e]),e=e.bind(t._storeImpl),a=r.Dispatcher.register(t,s.id,n,e),t._storeImpl.dispatcherIdsByAction[s.id]=a}}(this)),this},e.prototype.register=function(t){return this._storeImpl.callbacks.push(t)},e.prototype.unregister=function(t){return this._storeImpl.callbacks=u.reject(this._storeImpl.callbacks,function(i){return i===t})},e.prototype.listen=function(t){var i;return i=this,{componentDidMount:function(){return i.register(this[t])},componentWillUnmount:function(){return i.unregister(this[t])}}},e.prototype.trigger=function(){return this._storeImpl.trigger()},r.Store=e,p?module.exports=r:this.Hippodrome=r}).call(this);
@@ -1,3 +1,3 @@
1
1
  module Hippodrome
2
- VERSION = '0.0.23'
2
+ VERSION = '0.0.24'
3
3
  end
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hippodrome",
3
- "version": "0.0.23",
3
+ "version": "0.0.24",
4
4
  "description": "Your data, like your chariots, go around and around in one direction in this, a Flux implementation that only Ben Hur could love.",
5
5
  "main": "js/hippodrome.js",
6
6
  "scripts": {
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hippodrome
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.23
4
+ version: 0.0.24
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Kermes