From d5a02dd9342f5c61f3e3a9caf2082dd46b5099e3 Mon Sep 17 00:00:00 2001 From: "Avi Halachmi (:avih)" Date: Fri, 7 Aug 2020 13:42:27 +0300 Subject: js: hooks: allow deferred continuation (match d0ab562b) The callback now gets an object argument with defer/cont functions. Like the lua code, the behavior is that each hook event allows at most one continue, but nothing enforces the order of continuations if more hook events arrive before prior ones were continued - which is possible now with the defer option, but wasn't possible before (continuation was synchronous from the hook event handler). --- DOCS/man/javascript.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'DOCS/man') diff --git a/DOCS/man/javascript.rst b/DOCS/man/javascript.rst index 53e5771b54..1e5ce99cdc 100644 --- a/DOCS/man/javascript.rst +++ b/DOCS/man/javascript.rst @@ -193,7 +193,7 @@ success, ``fn`` is called always a-sync, ``error`` is empty string on success. ``mp.utils.getpid()`` (LE) -``mp.add_hook(type, priority, fn)`` +``mp.add_hook(type, priority, fn(hook))`` ``mp.options.read_options(obj [, identifier [, on_update]])`` (types: string/boolean/number) -- cgit v1.2.3