action-chain
Advanced tools
Comparing version 1.0.0-1532691371168 to 1.0.0-1532810720851
@@ -42,3 +42,3 @@ import * as tslib_1 from "tslib"; | ||
var effects = _this.actionChain.getEffects(thisExecution, executionContextWithPath); | ||
_this.actionChain.emit('operator:start', tslib_1.__assign({ type: type, | ||
_this.actionChain.emitAsync('operator:start', tslib_1.__assign({ type: type, | ||
name: name, | ||
@@ -48,7 +48,7 @@ path: path }, thisExecution)); | ||
if (result instanceof Promise) { | ||
_this.actionChain.emit('operator:async', tslib_1.__assign({ type: type, | ||
_this.actionChain.emitAsync('operator:async', tslib_1.__assign({ type: type, | ||
name: name, | ||
path: path, isAsync: true }, thisExecution)); | ||
return result.then(function (promiseResult) { | ||
_this.actionChain.emit('operator:end', tslib_1.__assign({ type: type, | ||
_this.actionChain.emitAsync('operator:end', tslib_1.__assign({ type: type, | ||
name: name, | ||
@@ -59,3 +59,3 @@ path: path }, thisExecution, { isAsync: true, result: promiseResult })); | ||
} | ||
_this.actionChain.emit('operator:end', tslib_1.__assign({ type: type, | ||
_this.actionChain.emitAsync('operator:end', tslib_1.__assign({ type: type, | ||
name: name, | ||
@@ -62,0 +62,0 @@ path: path }, thisExecution, { isAsync: false, result: result })); |
@@ -31,3 +31,3 @@ import { EventEmitter } from 'betsy'; | ||
export interface ActionChainEvents { | ||
provider: Execution & { | ||
effect: Execution & { | ||
name: string; | ||
@@ -34,0 +34,0 @@ method: string | number | symbol; |
@@ -29,7 +29,7 @@ import * as tslib_1 from "tslib"; | ||
result.then(function (promisedResult) { | ||
instance.emit('provider', tslib_1.__assign({}, execution, { name: path, method: prop, args: args, result: promisedResult })); | ||
instance.emitAsync('effect', tslib_1.__assign({}, execution, { name: path, method: prop, args: args, result: promisedResult })); | ||
}); | ||
} | ||
else { | ||
instance.emit('provider', tslib_1.__assign({}, execution, { name: path, method: prop, args: args, | ||
instance.emitAsync('effect', tslib_1.__assign({}, execution, { name: path, method: prop, args: args, | ||
result: result })); | ||
@@ -36,0 +36,0 @@ } |
@@ -47,2 +47,4 @@ import * as tslib_1 from "tslib"; | ||
var actionChain = new ActionChain(context); | ||
// FORCE SYNC EVENTS | ||
actionChain.emitAsync = actionChain.emit.bind(actionChain); | ||
var action = function () { | ||
@@ -90,3 +92,3 @@ return new Action(actionChain); | ||
}); | ||
describe('PROVIDER', function () { | ||
describe('EFFECTS', function () { | ||
test('should track execution of effects', function () { | ||
@@ -98,3 +100,3 @@ expect.assertions(2); | ||
}); | ||
actionChain.once('provider', function (task) { | ||
actionChain.once('effect', function (task) { | ||
expect(task).toEqual({ | ||
@@ -118,3 +120,3 @@ operatorId: 0, | ||
}); | ||
actionChain.once('provider', function (task) { | ||
actionChain.once('effect', function (task) { | ||
expect(task).toEqual({ | ||
@@ -138,3 +140,3 @@ operatorId: 0, | ||
}); | ||
actionChain.once('provider', function (task) { | ||
actionChain.once('effect', function (task) { | ||
expect(task).toEqual({ | ||
@@ -141,0 +143,0 @@ operatorId: 0, |
@@ -44,3 +44,3 @@ "use strict"; | ||
var effects = _this.actionChain.getEffects(thisExecution, executionContextWithPath); | ||
_this.actionChain.emit('operator:start', tslib_1.__assign({ type: type, | ||
_this.actionChain.emitAsync('operator:start', tslib_1.__assign({ type: type, | ||
name: name, | ||
@@ -50,7 +50,7 @@ path: path }, thisExecution)); | ||
if (result instanceof Promise) { | ||
_this.actionChain.emit('operator:async', tslib_1.__assign({ type: type, | ||
_this.actionChain.emitAsync('operator:async', tslib_1.__assign({ type: type, | ||
name: name, | ||
path: path, isAsync: true }, thisExecution)); | ||
return result.then(function (promiseResult) { | ||
_this.actionChain.emit('operator:end', tslib_1.__assign({ type: type, | ||
_this.actionChain.emitAsync('operator:end', tslib_1.__assign({ type: type, | ||
name: name, | ||
@@ -61,3 +61,3 @@ path: path }, thisExecution, { isAsync: true, result: promiseResult })); | ||
} | ||
_this.actionChain.emit('operator:end', tslib_1.__assign({ type: type, | ||
_this.actionChain.emitAsync('operator:end', tslib_1.__assign({ type: type, | ||
name: name, | ||
@@ -64,0 +64,0 @@ path: path }, thisExecution, { isAsync: false, result: result })); |
@@ -31,3 +31,3 @@ import { EventEmitter } from 'betsy'; | ||
export interface ActionChainEvents { | ||
provider: Execution & { | ||
effect: Execution & { | ||
name: string; | ||
@@ -34,0 +34,0 @@ method: string | number | symbol; |
@@ -31,7 +31,7 @@ "use strict"; | ||
result.then(function (promisedResult) { | ||
instance.emit('provider', tslib_1.__assign({}, execution, { name: path, method: prop, args: args, result: promisedResult })); | ||
instance.emitAsync('effect', tslib_1.__assign({}, execution, { name: path, method: prop, args: args, result: promisedResult })); | ||
}); | ||
} | ||
else { | ||
instance.emit('provider', tslib_1.__assign({}, execution, { name: path, method: prop, args: args, | ||
instance.emitAsync('effect', tslib_1.__assign({}, execution, { name: path, method: prop, args: args, | ||
result: result })); | ||
@@ -38,0 +38,0 @@ } |
@@ -49,2 +49,4 @@ "use strict"; | ||
var actionChain = new _1.ActionChain(context); | ||
// FORCE SYNC EVENTS | ||
actionChain.emitAsync = actionChain.emit.bind(actionChain); | ||
var action = function () { | ||
@@ -92,3 +94,3 @@ return new Action(actionChain); | ||
}); | ||
describe('PROVIDER', function () { | ||
describe('EFFECTS', function () { | ||
test('should track execution of effects', function () { | ||
@@ -100,3 +102,3 @@ expect.assertions(2); | ||
}); | ||
actionChain.once('provider', function (task) { | ||
actionChain.once('effect', function (task) { | ||
expect(task).toEqual({ | ||
@@ -120,3 +122,3 @@ operatorId: 0, | ||
}); | ||
actionChain.once('provider', function (task) { | ||
actionChain.once('effect', function (task) { | ||
expect(task).toEqual({ | ||
@@ -140,3 +142,3 @@ operatorId: 0, | ||
}); | ||
actionChain.once('provider', function (task) { | ||
actionChain.once('effect', function (task) { | ||
expect(task).toEqual({ | ||
@@ -143,0 +145,0 @@ operatorId: 0, |
{ | ||
"name": "action-chain", | ||
"version": "1.0.0-1532691371168", | ||
"version": "1.0.0-1532810720851", | ||
"description": "Functional actions", | ||
@@ -34,5 +34,5 @@ "author": "Christian Alfoni <christianalfoni@gmail.com>", | ||
"tslib": "^1.9.3", | ||
"betsy": "1.0.0-1532691371168" | ||
"betsy": "1.0.0-1532810720851" | ||
}, | ||
"devDependencies": {} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
109047
1111
+ Addedbetsy@1.0.0-1532810720851(transitive)
- Removedbetsy@1.0.0-1532691371168(transitive)
Updatedbetsy@1.0.0-1532810720851