3 `Nan::Callback` makes it easier to use `v8::Function` handles as callbacks. A class that wraps a `v8::Function` handle, protecting it from garbage collection and making it particularly useful for storage and use across asynchronous execution.
5 - <a href="#api_nan_callback"><b><code>Nan::Callback</code></b></a>
7 <a name="api_nan_callback"></a>
15 explicit Callback(const v8::Local<v8::Function> &fn);
19 bool operator==(const Callback &other) const;
21 bool operator!=(const Callback &other) const;
23 v8::Local<v8::Function> operator*() const;
25 v8::Local<v8::Value> operator()(v8::Local<v8::Object> target,
27 v8::Local<v8::Value> argv[] = 0) const;
29 v8::Local<v8::Value> operator()(int argc = 0,
30 v8::Local<v8::Value> argv[] = 0) const;
32 void SetFunction(const v8::Local<v8::Function> &fn);
34 v8::Local<v8::Function> GetFunction() const;
38 void Reset(const v8::Local<v8::Function> &fn);
42 v8::Local<v8::Value> Call(v8::Local<v8::Object> target,
44 v8::Local<v8::Value> argv[]) const;
46 v8::Local<v8::Value> Call(int argc, v8::Local<v8::Value> argv[]) const;
53 v8::Local<v8::Function> function;
54 Nan::Callback callback(function);