Open Koc opened 6 years ago
Do you have any API proposals?
I would like decorators too, but current state of decorators is cutting edge, so I will wait stable release of decorators in webpack (i.e. without flags)
WaitFor should have a decorator, it's hard to use.
before:
waitSomething = waitFor('somthing is waiting', async function() {
... doing
})
after:
@WaitFor('somthing is waiting')
async waitSomething () {
... doing
}
here is the implement
function WaitFor(waiter: string) {
return function decorator(target, name, descriptor) {
return waitFor(waiter, descriptor);
};
}
For now we need add to much mess code for using loading. Initiate start loading before action calling and call stop loading before each return or inside
finally
block. Is it possible enhance library with decorators? To add only one decorator above action.