Skip to content

Instantly share code, notes, and snippets.

View shivam-bisht's full-sized avatar
🎯
Focusing

shivam bisht shivam-bisht

🎯
Focusing
  • Rayabhari Technologies
  • banglore
View GitHub Profile
@shivam-bisht
shivam-bisht / workflow-demo.js
Created April 17, 2020 07:45 — forked from Fordi/workflow-demo.js
Javascript Workflow Processor
(function () {
var sayHi = function (token) {
if (!token.progress) token.progress = {};
token.progress.saidHi = (token.progress.saidHi||0) + 1;
//true == simply proceed; false == reject workflow
return true;
},
shakeIt = function (token, next) {
token.progress.shook = (token.progress.shook||0) + 1;
next('right');