shama / on-load

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

nesting on-load calls #21

Closed yoshuawuyts closed 7 years ago

yoshuawuyts commented 7 years ago

It'd be neat if we could nest on-load calls. This is currently not working, but I think it should be possible. The problem is that nested MutationObserver events are incorrectly caught, which causes observer nesting to fail. Unlike https://github.com/shama/on-load/pull/19 I suspect we can make this work without even with the currently globals (e.g. the incrementing counter should help us here).

cc/ @juliangruber

See also

yoshuawuyts commented 7 years ago

LOL NOPE ALL BETS ARE OFF THIS WORKS ALREADY https://github.com/shama/on-load/blob/master/test.js#L51-L68