shama / on-load

On load/unload events for DOM elements using a MutationObserver
113 stars 19 forks source link

observe document.documentElement instead of document.body #34

Closed lukeburns closed 6 years ago

lukeburns commented 6 years ago

currently, onload does not handle the following as one might hope.

document.body = onload(bel`<body>hello world</body>`, () => console.log('loaded'))

by observing changes to the root document element instead of the body element, this works as expected. are there reasons not to do this?

shama commented 6 years ago

That is a good change. Thanks a bunch!

lukeburns commented 6 years ago

👍