cofigure
Your own generator based flow-control
Supply processors
which will get used to process yielded values.
Processors consist of two things : an identify
function, and a process
function.
For each processor, the identify function will be used to check if the yielded value should be processed by the process function.
const stringToUpperProcessor =
Supply your processors to cofigure
and you should be good to go.
{ return text} const myRunner = // HELLO WORLD !
cofigure
runners return a Promise
which will get resolved with the generator return value, or rejected with the uncaught threw Error
.
Note : under the hood, processors are plain objects.
const myProcessor =identify: identifyFnprocess: processFnWe still recommend using
makeProcessor
in case thoses keys change in the future.
Examples
Promise processor
const promiseProcessor =
Generator processor
const generatorProcessor =