From e4442c978f32d20237c1ef9969c7402f56779964 Mon Sep 17 00:00:00 2001 From: Quinn Slack Date: Sat, 20 Apr 2019 02:03:25 -0700 Subject: [PATCH 1/3] instanceOf -> instanceof --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index afe01606..8312ee8d 100644 --- a/README.md +++ b/README.md @@ -70,7 +70,7 @@ Each function parameter and return value is given to _all_ registered transfer h ```js Comlink.transferHandlers.set("EVENT", { - canHandle: obj => obj instanceOf Event, + canHandle: obj => obj instanceof Event, serialize: ev => { return { target: { From 7e28a315421f5387cd48ee86fea819738dfc902e Mon Sep 17 00:00:00 2001 From: Quinn Slack Date: Sat, 20 Apr 2019 02:06:06 -0700 Subject: [PATCH 2/3] add commas --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8312ee8d..84fdd782 100644 --- a/README.md +++ b/README.md @@ -78,8 +78,8 @@ Comlink.transferHandlers.set("EVENT", { classList: [...ev.target.classList] } }; - } - deserialize: obj => obj + }, + deserialize: obj => obj, }); ``` From b4b716152c56eedcaea8e92962e92087920484fe Mon Sep 17 00:00:00 2001 From: Quinn Slack Date: Sat, 20 Apr 2019 02:07:42 -0700 Subject: [PATCH 3/3] serialize args --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 84fdd782..d03f399c 100644 --- a/README.md +++ b/README.md @@ -72,12 +72,12 @@ Each function parameter and return value is given to _all_ registered transfer h Comlink.transferHandlers.set("EVENT", { canHandle: obj => obj instanceof Event, serialize: ev => { - return { + return [{ target: { id: ev.target.id classList: [...ev.target.classList] } - }; + }, []]; }, deserialize: obj => obj, });