Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Latest
class EventHandlerReconciler
import { EventHandlerReconciler } from "https://deno.land/x/dom_diff@1.0.0-beta.2/reconcilers/event_handler.ts";

Event handler reconciler.

Examples

Example 1

import { EventHandlerReconciler } from "https://deno.land/x/dom_diff/reconcilers/event_handler.ts";
import { assertEquals } from "https://deno.land/std/testing/asserts.ts";
declare const listener: () => {};
const reconciler = new EventHandlerReconciler();
const oldNode = document.createElement("button");
const newNode = document.createElement("button");

newNode.onclick = listener;

const patches = reconciler.diff(oldNode, newNode);
for (const patch of patches) reconciler.update(oldNode, patch);

assertEquals(oldNode.onclick, listener);

Properties

diff
update