-
Notifications
You must be signed in to change notification settings - Fork 0
AsyncChore
paige edited this page Sep 20, 2023
·
6 revisions
Async Chores are async functions made from strings.
These can be beneficial to know for some occasions
const Class = require('aepl');
// creates a new class named Example
new Class("Example", class {
constructor() {
this.data = [1, 2, 3];
}
sleep(time) {
return new Promise(resolve => setTimeout(resolve, time*1000));
}
});
// creates a new chore named add using a string with function data
new Example.AsyncChore("add", "number", `
console.log(this.data); // [1, 2, 3]
await this.sleep(3); // waits for 3 seconds
this.data.push(number);
console.log(this.data); // [1, 2, 3, 4]
`);
// creates a new instance of the class
let example = new Example();
(async () => {
await example.add(4);
})();
description: creates a new async chore
calls:
- AsyncChore/asyncChore
- AChore/aChore
parameters:
- name
String
: name of the async chore- ...?parameters
String
: parameters for the async chore- value
String
: what the async chore does
note: too lazy to add any example for this you get it
If you want to check out the different versions and changes check out the releases
For a look into the development side check out the src folder
init()
from()
inspect()
new()
addClass()
addFunc()
addProp()
addChore()
addAsyncChore()
addPreClass()
addPreFunc()
addPreProp()
addPreChore()
addPreAChore()
setName()
setInspect()
Subclass
Function
Property
Chore
AsyncChore
Preclass
PreFunction
PreProperty
PreChore
PreAsyncChore
compact
multiple-layers
event handler
alternate names
setting and getting inspects