naugtur / insertionQuery

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

Same selector cannot be used in two instances #23

Open naugtur opened 8 years ago

naugtur commented 8 years ago

I don't think I can do much about it, because it's a clash with the CSS rules - there can be only one transition animation...

Maybe they can be shared. If not, insQ should throw an error when same selector is used again.

naugtur commented 7 years ago

Fix: make insQ aware there can be only one, merge functions set on the same selector and call both. Throwing an error is easier thought...

coleshirley commented 3 years ago

I know this is an old thread but a solution would be that when you call

insertionQ('div.comment').every(comment => {
// do stuff
}

insertionQ('div.comment').every(comment => {
// do stuff 2
}

you can store the callbacks for both functions in an array. Then when the event is fired you loop through the stored callbacks.