naugtur / insertionQuery

Non-dom-event way to catch nodes showing up. And it uses selectors.
Other
193 stars 32 forks source link

Is it possible to detect when a matching node is removed? #35

Closed Blake-LeBlanc closed 4 years ago

Blake-LeBlanc commented 4 years ago

Hello @naugtur !

Your plugin works great for detecting when new node elements are added and is very easy to use!

Is it possible for it to detect when the elements are removed as well?

I'm working with a drag-and-drop file upload plugin and I need to detect when a file is added or removed from the parent element.

Thanks for any help or insights!

All the best, Blake

naugtur commented 4 years ago

this is a workaround for wider browser support. but all modern browsers already have mutation observers. you should use them instead. they're a bit harder to use but way better than this

Blake-LeBlanc commented 4 years ago

Thank you Zbyszek!