Option to run the passed function right away
slavafomin opened this issue · 0 comments
slavafomin commented
Hello!
Thank you for this great library!
However, it would be nice to have an additional invocation option that will run the passed function right away without returning the decorated one.
const reallyDumbSleep = () => {
let i = 0;
while (i < 900000000) {
i++;
}
}
taim('zzz', reallyDumbSleep)();
Could be turned into:
const reallyDumbSleep = () => {
let i = 0;
while (i < 900000000) {
i++;
}
}
taim.run('zzz', reallyDumbSleep);
This will make the code easier to read due to the presence of run()
in invocation construct and the missing ()
at the end.
Thanks!