hippodrome 0.0.25 → 0.0.26

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: 4bede62bfabff37412be8a2a77b34c462cf39129
4
- data.tar.gz: 0851339e619a727f6dc56bbd7fb117445f52dd40
3
+ metadata.gz: 3d1e5ce73d63efc788d2ddbe6d4d8a79e7d10078
4
+ data.tar.gz: 27c49168056b4f15493441e9f5746686921f75e7
5
5
  SHA512:
6
- metadata.gz: 385c75fe65a11dce8e13075d9d15d5feebc894baab26c51869af3934ce8bc7fed2a5d7e888ca35d3bdbc008106779f1b75ad870948df52f440e0a44cbc17e77e
7
- data.tar.gz: 888d384c1a98f3daad65e477fa2d89b833c8c0b6949d297b2ab46fda0283fc05f17ec36b15bb3b9e2554ebf22b54f3b66ea12c8401fc984ca623672e28b9cf2a
6
+ metadata.gz: a0f19c4db36c3f6e116def21727dee747efacc1e7de2358751f7c63d8c58bcf9ba80ba8254dda902e7aa3581f85aca67ad2b588e03c603ade0f4da4dc95900fc
7
+ data.tar.gz: a82a40b35b4138e55ff48b1c0ab711667941ed75a4aa4a09f88063dbbf9067eb0a1e3f6960a9badbe7860c03c1b2b3bb8c62ae596621042d4fc832827461d728
@@ -175,6 +175,9 @@
175
175
  assert(!options.action || options.task, "Deferred Task " + this.displayName + " declared an action, it must declare a task.");
176
176
  _.assign(this, _.omit(options, 'dispatches', 'action', 'task'), bindToContextIfFunction(this));
177
177
  this._dispatcherIdsByAction = {};
178
+ if (options.initialize) {
179
+ options.initialize.call(this);
180
+ }
178
181
  if (options.action && options.task) {
179
182
  action = options.action, task = options.task;
180
183
  task = makeDeferredFunction(this, task);
@@ -1,3 +1,3 @@
1
1
  //= require lodash
2
2
 
3
- (function(){var t,i,s,e,r,n,a,c,o,l,p,h,u,d=[].slice;p="undefined"==typeof window,u=p?require("lodash"):this._,e={},c=function(){var t,i,s,e,r;if(s=arguments[0],r=arguments[1],i=3<=arguments.length?d.call(arguments,2):[],!s)throw t=0,e=new Error("Assertion Failed: "+r.replace(/%s/g,function(){return i[t++]})),e.framesToPop=1,e;return s},r=function(t){return this._lastId=1,this._prefix=t},r.prototype.next=function(){return""+this._prefix+"_"+this._lastId++},a=new r("Action_ID"),t=function(t,i){var s,r,n,c;return n=""+a.next()+"_"+t,r=function(){var t;return t=i.apply(null,arguments),t.action=n,t},c=function(t){return e.Dispatcher.dispatch(t)},s=function(){var t;return t=r.apply(null,arguments),c(t)},s.buildPayload=r,s.send=c,s.displayName=t,s.id=n,s.toString=function(){return n},s},e.Action=t,s=function(){return this._callbacksByAction={},this._isStarted={},this._isFinished={},this._isDispatching=!1,this._payload=null},l=new r("Dispatcher_ID"),s.prototype.register=function(){var t,i,s,e,r,n,a;return i=u.compact(arguments),3===i.length?this.register(i[0],i[1],[],i[2]):(n=i[0],t=i[1],r=i[2],s=i[3],null==(a=this._callbacksByAction)[t]&&(a[t]={}),e=l.next(),this._callbacksByAction[t][e]={callback:s,prerequisites:u.map(r,function(i){return i._storeImpl.dispatcherIdsByAction[t]})},e)},s.prototype.unregister=function(t,i){return c(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 c(this._isDispatching,"Dispatcher.waitFor must be invoked while dispatching."),u.forEach(i,function(i){return function(s){return i._isStarted[s]?void c(i._isFinished[s],"Dispatcher.waitFor encountered circular dependency while waiting for `%s` during %s.",s,t.displayName):(c(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;c(!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,e){return t._isStarted[e]?void 0:t.invokeCallback(i,e)}}(this))}finally{this.stopDispatching()}},s.prototype.invokeCallback=function(t,i){var s,e,r;return this._isStarted[i]=!0,r=this._callbacksByAction[t][i],s=r.callback,e=r.prerequisites,this.waitFor(t,e),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},e.Dispatcher=new s,h=function(t,i){return"string"==typeof i&&(i=t[i]),i=u.defer.bind(t,i)},i=function(t){var i,s,r;return this.displayName=t.displayName,c(t.action||t.dispatches,"Deferred Task "+this.displayName+" must include either an action key or dispatches list."),c(!t.action||t.task,"Deferred Task "+this.displayName+" declared an action, it must declare a task."),u.assign(this,u.omit(t,"dispatches","action","task"),o(this)),this._dispatcherIdsByAction={},t.action&&t.task&&(i=t.action,r=t.task,r=h(this,r),s=e.Dispatcher.register(this,i.id,[],r),this._dispatcherIdsByAction[i.id]=s),t.dispatches&&u.forEach(t.dispatches,function(t){return function(r){var n;return i=r.action,n=r.callback,c(!t._dispatcherIdsByAction[i.id],"Deferred Task "+t.displayName+" registered two callbacks for the action "+i.displayName+"."),n=h(t,n),s=e.Dispatcher.register(t,i.id,[],n),t._dispatcherIdsByAction[i.id]=s}}(this)),this},e.DeferredTask=i,o=function(t){return function(i,s){return s instanceof Function?s.bind(t):s}},n=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"),o(this._storeImpl)),t["public"]&&(u.assign(this,t["public"],o(this._storeImpl)),u.assign(this._storeImpl,t["public"],o(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,r,n,a;return s=i.action,r=i.after,n=i.callback,c(!t._storeImpl.dispatcherIdsByAction[s.id],"Store "+t.displayName+" registered two callbacks for action "+s.displayName),"string"==typeof n&&(n=t._storeImpl[n]),n=n.bind(t._storeImpl),a=e.Dispatcher.register(t,s.id,r,n),t._storeImpl.dispatcherIdsByAction[s.id]=a}}(this)),this},n.prototype.register=function(t){return this._storeImpl.callbacks.push(t)},n.prototype.unregister=function(t){return this._storeImpl.callbacks=u.reject(this._storeImpl.callbacks,function(i){return i===t})},n.prototype.listen=function(t){var i;return i=this,{componentDidMount:function(){return i.register(this[t])},componentWillUnmount:function(){return i.unregister(this[t])}}},n.prototype.trigger=function(){return this._storeImpl.trigger()},e.Store=n,p?module.exports=e:this.Hippodrome=e}).call(this);
3
+ (function(){var t,i,s,e,r,n,a,c,o,l,p,h,u,d=[].slice;p="undefined"==typeof window,u=p?require("lodash"):this._,e={},c=function(){var t,i,s,e,r;if(s=arguments[0],r=arguments[1],i=3<=arguments.length?d.call(arguments,2):[],!s)throw t=0,e=new Error("Assertion Failed: "+r.replace(/%s/g,function(){return i[t++]})),e.framesToPop=1,e;return s},r=function(t){return this._lastId=1,this._prefix=t},r.prototype.next=function(){return""+this._prefix+"_"+this._lastId++},a=new r("Action_ID"),t=function(t,i){var s,r,n,c;return n=""+a.next()+"_"+t,r=function(){var t;return t=i.apply(null,arguments),t.action=n,t},c=function(t){return e.Dispatcher.dispatch(t)},s=function(){var t;return t=r.apply(null,arguments),c(t)},s.buildPayload=r,s.send=c,s.displayName=t,s.id=n,s.toString=function(){return n},s},e.Action=t,s=function(){return this._callbacksByAction={},this._isStarted={},this._isFinished={},this._isDispatching=!1,this._payload=null},l=new r("Dispatcher_ID"),s.prototype.register=function(){var t,i,s,e,r,n,a;return i=u.compact(arguments),3===i.length?this.register(i[0],i[1],[],i[2]):(n=i[0],t=i[1],r=i[2],s=i[3],null==(a=this._callbacksByAction)[t]&&(a[t]={}),e=l.next(),this._callbacksByAction[t][e]={callback:s,prerequisites:u.map(r,function(i){return i._storeImpl.dispatcherIdsByAction[t]})},e)},s.prototype.unregister=function(t,i){return c(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 c(this._isDispatching,"Dispatcher.waitFor must be invoked while dispatching."),u.forEach(i,function(i){return function(s){return i._isStarted[s]?void c(i._isFinished[s],"Dispatcher.waitFor encountered circular dependency while waiting for `%s` during %s.",s,t.displayName):(c(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;c(!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,e){return t._isStarted[e]?void 0:t.invokeCallback(i,e)}}(this))}finally{this.stopDispatching()}},s.prototype.invokeCallback=function(t,i){var s,e,r;return this._isStarted[i]=!0,r=this._callbacksByAction[t][i],s=r.callback,e=r.prerequisites,this.waitFor(t,e),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},e.Dispatcher=new s,h=function(t,i){return"string"==typeof i&&(i=t[i]),i=u.defer.bind(t,i)},i=function(t){var i,s,r;return this.displayName=t.displayName,c(t.action||t.dispatches,"Deferred Task "+this.displayName+" must include either an action key or dispatches list."),c(!t.action||t.task,"Deferred Task "+this.displayName+" declared an action, it must declare a task."),u.assign(this,u.omit(t,"dispatches","action","task"),o(this)),this._dispatcherIdsByAction={},t.initialize&&t.initialize.call(this),t.action&&t.task&&(i=t.action,r=t.task,r=h(this,r),s=e.Dispatcher.register(this,i.id,[],r),this._dispatcherIdsByAction[i.id]=s),t.dispatches&&u.forEach(t.dispatches,function(t){return function(r){var n;return i=r.action,n=r.callback,c(!t._dispatcherIdsByAction[i.id],"Deferred Task "+t.displayName+" registered two callbacks for the action "+i.displayName+"."),n=h(t,n),s=e.Dispatcher.register(t,i.id,[],n),t._dispatcherIdsByAction[i.id]=s}}(this)),this},e.DeferredTask=i,o=function(t){return function(i,s){return s instanceof Function?s.bind(t):s}},n=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"),o(this._storeImpl)),t["public"]&&(u.assign(this,t["public"],o(this._storeImpl)),u.assign(this._storeImpl,t["public"],o(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,r,n,a;return s=i.action,r=i.after,n=i.callback,c(!t._storeImpl.dispatcherIdsByAction[s.id],"Store "+t.displayName+" registered two callbacks for action "+s.displayName),"string"==typeof n&&(n=t._storeImpl[n]),n=n.bind(t._storeImpl),a=e.Dispatcher.register(t,s.id,r,n),t._storeImpl.dispatcherIdsByAction[s.id]=a}}(this)),this},n.prototype.register=function(t){return this._storeImpl.callbacks.push(t)},n.prototype.unregister=function(t){return this._storeImpl.callbacks=u.reject(this._storeImpl.callbacks,function(i){return i===t})},n.prototype.listen=function(t){var i;return i=this,{componentDidMount:function(){return i.register(this[t])},componentWillUnmount:function(){return i.unregister(this[t])}}},n.prototype.trigger=function(){return this._storeImpl.trigger()},e.Store=n,p?module.exports=e:this.Hippodrome=e}).call(this);
@@ -1,3 +1,3 @@
1
1
  module Hippodrome
2
- VERSION = '0.0.25'
2
+ VERSION = '0.0.26'
3
3
  end
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hippodrome",
3
- "version": "0.0.25",
3
+ "version": "0.0.26",
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.25
4
+ version: 0.0.26
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Kermes
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-10-27 00:00:00.000000000 Z
12
+ date: 2014-10-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler