Skip to content

Commit

Permalink
doc: link threadsafe function from JS function
Browse files Browse the repository at this point in the history
* doc: link threadsafe function from JS function
  • Loading branch information
legendecas committed Feb 17, 2020
1 parent 7f56a78 commit baaaa84
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions doc/function.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ functions that were created in JavaScript and passed to the native add-on.
The `Napi::Function` class inherits its behavior from the `Napi::Object` class (for more info
see: [`Napi::Object`](object.md)).

> For callbacks that will be called with asynchronous events from a
> non-JavaScript thread, please refer to [`Napi::ThreadSafeFunction`][] for more
> examples.
## Example

```cpp
Expand Down Expand Up @@ -393,3 +397,5 @@ Napi::Value Napi::Function::operator ()(const std::initializer_list<napi_value>&
- `[in] args`: Initializer list of JavaScript values as `napi_value`.

Returns a `Napi::Value` representing the JavaScript value returned by the function.

[`Napi::ThreadSafeFunction`]: ./threadsafe_function.md

0 comments on commit baaaa84

Please sign in to comment.