developit / greenlet

🦎 Move an async function into its own thread.
https://npm.im/greenlet
4.67k stars 100 forks source link

Pass data in to function #39

Open rektide opened 5 years ago

rektide commented 5 years ago

In the similar, Node.JS oriented library microtask, one can pass arguments in to a function. This would be a nice feature to have in greenlet too.

developit commented 4 years ago

Hiya! I'm not sure I follow - would this be different from Greenlet's current support for calling arguments?

const foo = greenlet((a, b, c) => [a, b, c]);
await foo(1, 2, 3)  // [1,2,3]