Processing
Class to be able to execute function chains
import { Processing } from "@schukai/monster/source/util/processing.mjs";A Simple Example
import {Processing} from '@schukai/monster/source/util/processing.mjs';
let startTime = +new Date();
new Processing((url) => {
return fetch(url)
}, (response) => {
// do something with the response
console.log(response.status, +new Date() - startTime)
}, 200, () => {
// this function is called 200 seconds after fetch is received.
console.log('finished', +new Date() - startTime)
return 'done'
}).run('https://monsterjs.org/assets/world.json').then(r => {
console.log(r)
// ↦ "done"
})Exported
ProcessingDerived from
BaseOptions
The Options listed in this section are defined directly within the class. This class is derived from several parent classes. Therefore, it inherits Options from these parent classes. If you cannot find a specific Options in this list, we recommend consulting the documentation of the Base.
Properties
The Properties listed in this section are defined directly within the class. This class is derived from several parent classes. Therefore, it inherits Properties from these parent classes. If you cannot find a specific Properties in this list, we recommend consulting the documentation of the Base.
Methods
The methods listed in this section are defined directly within the class. This class is derived from several parent classes. Therefore, it inherits methods from these parent classes. If you cannot find a specific method in this list, we recommend consulting the documentation of the Base.
Constructor
constructor(args)args{...(int|function)}: args
timeout1, function1, function2, function3, timeout2, function4 the timeout1 is valid for the functions 1, 2 and 3 and the timeout2 for the function4. So the execution time is timeout1+timeout1+timeout1+timeout2Behavioral methods
add(callback,time)callback{function}: callbacktime{int|undefined}: time
{TypeError}value is not a function{TypeError}value is not an integer
Other methods
run(data)data{*}: data
- {Promise}
Events
This component does not fire any public events. It may fire events that are inherited from its parent classes.