feat: window.onunload (#3023)

This commit is contained in:
Bartek Iwańczuk 2019-10-02 17:32:51 +02:00 committed by Ryan Dahl
parent d32f39f2ec
commit c920c5f62a
9 changed files with 126 additions and 20 deletions

View file

@ -1,7 +1,10 @@
window.addEventListener(
"load",
(e: Event): void => {
console.log(`got ${e.type} event in event handler (nest_imported)`);
}
);
import { assert } from "../../../js/deps/https/deno.land/std/testing/asserts.ts";
const handler = (e: Event): void => {
assert(!e.cancelable);
console.log(`got ${e.type} event in event handler (nest_imported)`);
};
window.addEventListener("load", handler);
window.addEventListener("unload", handler);
console.log("log from nest_imported script");