From a2174e3fda3efd04e1b97372a905d35f68bbc340 Mon Sep 17 00:00:00 2001 From: Damien Arrachequesne Date: Fri, 17 Nov 2023 10:37:18 +0100 Subject: [PATCH] docs: add onAnyOutgoing() method in the tutorial --- docs/tutorial/07-api-overview.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/tutorial/07-api-overview.md b/docs/tutorial/07-api-overview.md index deef7fc8..d45ecb96 100644 --- a/docs/tutorial/07-api-overview.md +++ b/docs/tutorial/07-api-overview.md @@ -283,6 +283,15 @@ socket.onAny((eventName, ...args) => { }); ``` +Similarly, for outgoing packets: + +```js +socket.onAnyOutgoing((eventName, ...args) => { + console.log(eventName); // 'hello' + console.log(args); // [ 1, '2', { 3: '4', 5: ArrayBuffer (1) [ 6 ] } ] +}); +``` + ## Server API ### Broadcasting