Since nodejs/node#27791 has been landed, there might be some use cases on node-addon-api to use Napi::ThreadSafeFunction with optional callback parameter.
Approaches might be adding an example of how to use existing Napi::ThreadSafeFunction::New like:
Function callback;
auto tsfn = ThreadSafeFunction::New(env, callback, resource_name, 1, 1);
(is there a more intuitive one?)
Or add a new API which make the callback omitted:
auto tsfn = ThreadSafeFunction::New(env, resource_name, 1, 1);