hippodrome 0.1.7 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/hippodrome.js +11 -2
- data/app/assets/javascripts/hippodrome.min.js +1 -1
- data/lib/hippodrome/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3bb092221b5b0a477d3bedcdaf4fbc532ecc5c91
|
4
|
+
data.tar.gz: e6387d77205f198dca6de17cc44ec849fdf180c4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8811d6d654b9b49a2ad3d5ff346d2c27dfb9b72bac4e3859b405448d41edfc84091eebea41b6194af5d0cd82773a3643b316d69fb03ce73e3af75ee3de9a77f1
|
7
|
+
data.tar.gz: 01136d11b4d14c2b4a6d15be520b8d730041e904b83db20386a7c96325ff4cccd845885c0e059eee29841cfe7b683b99af619ffa69a6f471047e009c66820461
|
@@ -232,20 +232,29 @@
|
|
232
232
|
_.assign(this._storeImpl, options["public"], bindToContextIfFunction(this._storeImpl));
|
233
233
|
}
|
234
234
|
this.displayName = options.displayName;
|
235
|
+
this.lastActionId = (function(_this) {
|
236
|
+
return function() {
|
237
|
+
return _this._storeImpl._lastActionId;
|
238
|
+
};
|
239
|
+
})(this);
|
235
240
|
if (options.initialize) {
|
236
241
|
options.initialize.call(this._storeImpl);
|
237
242
|
}
|
238
243
|
if (options.dispatches) {
|
239
244
|
_.forEach(options.dispatches, (function(_this) {
|
240
245
|
return function(dispatch) {
|
241
|
-
var action, after, callback, id;
|
246
|
+
var action, after, callback, handleAction, id;
|
242
247
|
action = dispatch.action, after = dispatch.after, callback = dispatch.callback;
|
243
248
|
assert(!_this._storeImpl.dispatcherIdsByAction[action.id], "Store " + _this.displayName + " registered two callbacks for action " + action.displayName);
|
244
249
|
if (typeof callback === 'string') {
|
245
250
|
callback = _this._storeImpl[callback];
|
246
251
|
}
|
247
252
|
callback = callback.bind(_this._storeImpl);
|
248
|
-
|
253
|
+
handleAction = (function(payload) {
|
254
|
+
this._lastActionId = payload.action;
|
255
|
+
return callback(payload);
|
256
|
+
}).bind(_this._storeImpl);
|
257
|
+
id = Hippodrome.Dispatcher.register(_this, action.id, after, handleAction);
|
249
258
|
return _this._storeImpl.dispatcherIdsByAction[action.id] = id;
|
250
259
|
};
|
251
260
|
})(this));
|
@@ -1,3 +1,3 @@
|
|
1
1
|
//= require lodash
|
2
2
|
|
3
|
-
(function(){var t,i,s,e,r,
|
3
|
+
(function(){var t,i,s,n,e,r,a,c,o,l,p,u,h,d=[].slice;p="undefined"==typeof window,h=p?require("lodash"):this._,n={},c=function(){var t,i,s,n,e;if(s=arguments[0],e=arguments[1],i=3<=arguments.length?d.call(arguments,2):[],!s)throw t=0,n=new Error("Assertion Failed: "+e.replace(/%s/g,function(){return i[t++]})),n.framesToPop=1,n;return s},e=function(t){return this._lastId=1,this._prefix=t},e.prototype.next=function(){return""+this._prefix+"_"+this._lastId++},a=new e("Action_ID"),t=function(t,i){var s,e,r,c;return r=""+a.next()+"_"+t,e=function(){var t;return t=i.apply(null,arguments),t.action=r,t},c=function(t){return n.Dispatcher.dispatch(t)},s=function(){var t;return t=e.apply(null,arguments),c(t)},s.buildPayload=e,s.send=c,s.displayName=t,s.id=r,s.toString=function(){return r},s},n.Action=t,s=function(){return this._callbacksByAction={},this._isStarted={},this._isFinished={},this._isDispatching=!1,this._payload=null},l=new e("Dispatcher_ID"),s.prototype.register=function(){var t,i,s,n,e,r,a;return i=h.compact(arguments),3===i.length?this.register(i[0],i[1],[],i[2]):(r=i[0],t=i[1],e=i[2],s=i[3],null==(a=this._callbacksByAction)[t]&&(a[t]={}),n=l.next(),this._callbacksByAction[t][n]={callback:s,prerequisites:h.map(e,function(i){return i._storeImpl.dispatcherIdsByAction[t]})},n)},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."),h.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,h.forEach(this._callbacksByAction[i],function(t){return function(s,n){return t._isStarted[n]?void 0:t.invokeCallback(i,n)}}(this))}finally{this.stopDispatching()}},s.prototype.invokeCallback=function(t,i){var s,n,e;return this._isStarted[i]=!0,e=this._callbacksByAction[t][i],s=e.callback,n=e.prerequisites,this.waitFor(t,n),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},n.Dispatcher=new s,u=function(t,i){return"string"==typeof i&&(i=t[i]),function(){var s;return s=arguments,setTimeout(function(){return i.apply(t,s)},1)}},i=function(t){var i,s,e;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."),h.assign(this,h.omit(t,"dispatches","action","task"),o(this)),this._dispatcherIdsByAction={},t.initialize&&t.initialize.call(this),t.action&&t.task&&(i=t.action,e=t.task,e=u(this,e),s=n.Dispatcher.register(this,i.id,[],e),this._dispatcherIdsByAction[i.id]=s),t.dispatches&&h.forEach(t.dispatches,function(t){return function(e){var r;return i=e.action,r=e.callback,c(!t._dispatcherIdsByAction[i.id],"Deferred Task "+t.displayName+" registered two callbacks for the action "+i.displayName+"."),r=u(t,r),s=n.Dispatcher.register(t,i.id,[],r),t._dispatcherIdsByAction[i.id]=s}}(this)),this},n.DeferredTask=i,o=function(t){return function(i,s){return s instanceof Function?s.bind(t):s}},r=function(t){return this._storeImpl={trigger:function(){return h.each(this.callbacks,function(t){return t()})}},this._storeImpl.dispatcherIdsByAction={},this._storeImpl.callbacks=[],h.assign(this._storeImpl,h.omit(t,"initialize","dispatches","public"),o(this._storeImpl)),t["public"]&&(h.assign(this,t["public"],o(this._storeImpl)),h.assign(this._storeImpl,t["public"],o(this._storeImpl))),this.displayName=t.displayName,this.lastActionId=function(t){return function(){return t._storeImpl._lastActionId}}(this),t.initialize&&t.initialize.call(this._storeImpl),t.dispatches&&h.forEach(t.dispatches,function(t){return function(i){var s,e,r,a,o;return s=i.action,e=i.after,r=i.callback,c(!t._storeImpl.dispatcherIdsByAction[s.id],"Store "+t.displayName+" registered two callbacks for action "+s.displayName),"string"==typeof r&&(r=t._storeImpl[r]),r=r.bind(t._storeImpl),a=function(t){return this._lastActionId=t.action,r(t)}.bind(t._storeImpl),o=n.Dispatcher.register(t,s.id,e,a),t._storeImpl.dispatcherIdsByAction[s.id]=o}}(this)),this},r.prototype.register=function(t){return this._storeImpl.callbacks.push(t)},r.prototype.unregister=function(t){return this._storeImpl.callbacks=h.reject(this._storeImpl.callbacks,function(i){return i===t})},r.prototype.listen=function(t){var i;return i=this,{componentDidMount:function(){return i.register(this[t])},componentWillUnmount:function(){return i.unregister(this[t])}}},r.prototype.trigger=function(){return this._storeImpl.trigger()},n.Store=r,p?module.exports=n:this.Hippodrome=n}).call(this);
|
data/lib/hippodrome/version.rb
CHANGED
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.1.
|
4
|
+
version: 0.1.8
|
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-
|
12
|
+
date: 2014-12-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|