Skip to content

Commit

Permalink
refactor: move MessageEventListener to EventTarget
Browse files Browse the repository at this point in the history
  • Loading branch information
Tony Fettes committed Aug 5, 2024
1 parent 8983a49 commit 3c9a22d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 10 additions & 0 deletions src/Webapi/Dom/Webapi__Dom__EventTarget.re
Original file line number Diff line number Diff line change
Expand Up @@ -2296,6 +2296,16 @@ module Impl = (T: {
) =>
unit =
"removeEventListener";

[@mel.send.pipe: T.t]
external addMessageEventListener:
([@mel.as "message"] _, Dom.messageEvent => unit) => unit =
"addEventListener";

[@mel.send.pipe: t]
external removeMessageEventListener:
([@mel.as "message"] _, Dom.messageEvent => unit) => unit =
"removeEventListener";
};

include Impl({
Expand Down
10 changes: 0 additions & 10 deletions src/Webapi/Dom/Webapi__Dom__Worker.re
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,6 @@ include Webapi__Dom__EventTarget.Impl({
[@mel.send.pipe: t] external postMessage: 'a => unit = "postMessage";
[@mel.send.pipe: t] external terminate: unit = "terminate";

[@mel.send.pipe: t]
external addMessageEventListener:
([@mel.as "message"] _, Dom.messageEvent => unit) => unit =
"addEventListener";

[@mel.send.pipe: t]
external removeMessageEventListener:
([@mel.as "message"] _, Dom.messageEvent => unit) => unit =
"removeEventListener";

[@mel.set]
external setOnError: (t, Dom.errorEvent => unit) => unit = "onerror";
[@mel.set]
Expand Down

0 comments on commit 3c9a22d

Please sign in to comment.