From abcf86a3ba4ef1c7540fb215c54bd0b5458fa2a5 Mon Sep 17 00:00:00 2001 From: raub Date: Mon, 14 May 2018 11:36:47 +0300 Subject: [PATCH] :memo: Update doc --- README.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index a810a70..c2bf3d4 100644 --- a/README.md +++ b/README.md @@ -699,13 +699,13 @@ EventEmitter behavior and is exported to JS. For the C++ side `EventEmitter` has following public methods: -* `void emit(const std::string &name, int argc = 0, v8::Local *argv = NULL)` +* `void emit(const std::string &name, int argc = 0, v8::Local *argv = NULL)` - emits an event with the given `name` and, optionally, some additional arguments where `argc` is the number of arguments and `argv` is a pointer to the arguments array. -* `void on(const std::string &name, v8::Local that, const std::string &method)` -subscribes `that[method]` to receive `name` events from this emitter, basically -`emitter.on(name, that[method])`. +* `void on(const std::string &name, V8_VAR_FUNC cb)` - +subscribes `cb` to receive `name` events from this emitter, basically +`emitter.on(name, cb)`. * `virtual void _destroy()` - destroys the object, i.e. deactivates it and frees resources. This is what also called inside @@ -784,3 +784,5 @@ receives any set of arguments. * `inline void consoleLog(const std::string &message)` - an alias to log a single string. + +> Note: Don't do it in GC-accessible code: sometimes it works, sometimes it crashes.