This repository was archived by the owner on Apr 22, 2023. It is now read-only.
This repository was archived by the owner on Apr 22, 2023. It is now read-only.
[domain] [feat-req] domain.run function with parameters #7193
Closed
Description
It would be great to be able to define the parameters for the function that is called inside the domain.run(fn)
method.
I propose this API change:
domain.run(fn, [arg1], [arg2], [...])
An example of use:
function justDoSomething(a, b, c) {
/* do something else */
return a + b + c;
}
mathDomain.run(justDoSomething, 1, 2, 3);
This approach would allow to use values from the current context and run a function that is outside of this context as it is implemented in setTimeout()
or setInterval()
.