anothersequencer
Advanced tools
Comparing version 0.1.3 to 0.1.4
{ | ||
"name": "anothersequencer", | ||
"version": "0.1.3", | ||
"version": "0.1.4", | ||
"description": "Simple script tree sequencer in javascript. Allows creating fairly complex trees of sync/async functions or requestAnimationFrame functions with optional delays, as well as subscribing to particular outputs in the tree at any time.", | ||
@@ -5,0 +5,0 @@ "main": "sequencer.js", |
@@ -32,3 +32,3 @@ ## Javascript function sequencing | ||
let sequence2 = { //create a sequence object or array, can mix and match for each layer as well | ||
operation:(input)=>{ | ||
operation:(input)=>{ //.operation, .op, .f, .fn, .callback all work | ||
console.log('b',input); | ||
@@ -35,0 +35,0 @@ return 5; |
@@ -180,2 +180,12 @@ //Simple script sequencer | ||
let run = async (o,prev,tick=1) => { | ||
//supports different shorthand | ||
if(o.operation) true; | ||
else if(o.op) o.operation = o.op; | ||
else if (o.o) o.operation = o.o; | ||
else if (o.f) o.operation = o.f; | ||
else if (o.fn) o.operaiion = o.fn; | ||
else if (o.callback) o.operation = o.callback; | ||
else return prev; | ||
let result = await o.operation(prev); | ||
@@ -182,0 +192,0 @@ if(o.tag) this.state.setState(o.tag,result); |
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
61776
272