Typescript method decorator that wraps the WaitFor class.
import { WaitFor } from'waitfor.ts';
let logit = false;
functionresolver() {
setTimeout(() => logit = true, 500);
}
class SomeCoolThing {
@WaitFor(resolver);
public imPatient(): string {
console.log('It took about half a second, but i have arrived');
}
}
// in your implementationnew SomeCoolThing().imPatient(); // will log after 500ms
Typescript method decorator that wraps the WaitFor class.
import { WaitFor } from 'waitfor.ts'; let logit = false; function resolver() { setTimeout(() => logit = true, 500); } class SomeCoolThing { @WaitFor(resolver); public imPatient(): string { console.log('It took about half a second, but i have arrived'); } } // in your implementation new SomeCoolThing().imPatient(); // will log after 500ms