ws-async-base
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

Asyncable class base : Delay in your custom class as sync-syntax is enabled.

install this package:

npm install ws-async-base

Use it

First, make extends for your custom class:

export class MyClass extends AsyncableClassBase {
    // ......
}

Then, you and wait in your code like this:

testFuct = async () => {
    //  DO work 01
    await this.Delay(50);
    // DO work 02 ......
}

Or you and wait in your code like this:

testFuct = async () => {
    await this.DoAndWait(()=>{
        console.log('I am your father!');
    }, 5000);
    console.log('hhhhhh');
}
 
testFuct = async () => {
    await this.WaitAndDo(()=>{
        console.log('I am your mother!');
    }, 5000);
    console.log('hhhhhh');
}

It's easy.

Readme

Keywords

none

Package Sidebar

Install

npm i ws-async-base

Weekly Downloads

4

Version

1.0.2

License

MIT

Last publish

Collaborators

  • migician