Comparing version 0.2.0 to 0.2.1
@@ -23,2 +23,6 @@ 'use strict'; | ||
function id(x) { | ||
return x; | ||
} | ||
var Store = (function (_Rx$BehaviorSubject) { | ||
@@ -37,20 +41,12 @@ function Store() { | ||
key: 'register', | ||
value: function register(action) { | ||
value: function register(action, callback, successCallback, failureCallback) { | ||
var _this = this; | ||
var callback = arguments[1] === undefined ? function (x) { | ||
return x; | ||
} : arguments[1]; | ||
var successCallback = arguments[2] === undefined ? function (x) { | ||
return x; | ||
} : arguments[2]; | ||
var failureCallback = arguments[3] === undefined ? function (x) { | ||
return x; | ||
} : arguments[3]; | ||
var subscription = action.subscribe(function (params) { | ||
var _ref; | ||
var subscription = action.subscribe(function (params) { | ||
return _this.onNext(callback.call.apply(callback, [_this, _this.getValue()].concat(_toConsumableArray(params)))); | ||
return _this.onNext((_ref = callback || id).call.apply(_ref, [_this, _this.getValue()].concat(_toConsumableArray(params)))); | ||
}); | ||
if (action.Success && action.Failure) { | ||
if (successCallback && failureCallback && action.Success && action.Failure) { | ||
return _Rx2['default'].CompositeDisposable(subscription, action.Success.subscribe(function (params) { | ||
@@ -57,0 +53,0 @@ return _this.onNext(successCallback.call.apply(successCallback, [_this, _this.getValue()].concat(_toConsumableArray(params)))); |
{ | ||
"name": "flurx", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"description": "Flux using RxJS, advocating but not strictly enforcing immutable data structures", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16799
9
275