Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Event antiflood #28

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

anton-ryzhov
Copy link
Contributor

Synchronous version of #22 , implementation of #22 (comment) idea.

Decorate (and undecorate) collection.sync method to intercept update and receive presync event (https://github.com/jashkenas/backbone/blob/1.1.2/backbone.js#L863 https://github.com/paulmillr/exoskeleton/blob/0.7.0/exoskeleton.js#L1090)

Lock all update events during ajax-driven collection update and then trigger custom update event for all listening BackboneCollectionWrappers.

Old synchronous tests approve this patch.

@anton-ryzhov
Copy link
Contributor Author

I've found that this version doesn't fully solve issue, It still pretty slow in some cases. #22 worked better. I'll work on this PR.

But @rstacruz, @Rich-Harris, I still want your feedback about this implementation.

@anton-ryzhov
Copy link
Contributor Author

Ok, it was simple but painful bug. Now it works good for me and can fully replace #22

@anton-ryzhov
Copy link
Contributor Author

Last commit 9e8e4de doesn't relate to this PR and may be useful separately. Should protect from such bugs in future.

@anton-ryzhov
Copy link
Contributor Author

Ok, initial idea with patched set works too, even with simpler implementation and the same result.

@anton-ryzhov
Copy link
Contributor Author

@rstacruz, @Rich-Harris, guys, what about this PR?
I'm using it all this time and have no issues with it.

@fabien
Copy link

fabien commented Feb 6, 2015

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants