diff --git a/README.md b/README.md index afe01606..d03f399c 100644 --- a/README.md +++ b/README.md @@ -70,16 +70,16 @@ 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 { + return [{ target: { id: ev.target.id classList: [...ev.target.classList] } - }; - } - deserialize: obj => obj + }, []]; + }, + deserialize: obj => obj, }); ```