neon-bindings / rfcs

RFCs for changes to Neon
Apache License 2.0
14 stars 9 forks source link

Futures RFC #46

Open kjvalencik opened 2 years ago

kjvalencik commented 2 years ago

I propose that we only implement this for Node-API >= 5, allowing the usage of JsFunction::new from closures. This simplifies the state management.

If we would like to support this for lower versions, we will need to find an alternate way to track the state. For example, putting it in a JsBox and calling Function.prototype.bind on our .then and .catch methods.