jmorrell / backbone.obscura

A read-only proxy of a Backbone.Collection that can be filtered, sorted, and paginated.
http://jmorrell.github.io/backbone.obscura/
MIT License
107 stars 19 forks source link

Add sync events #21

Closed Florian-R closed 8 years ago

Florian-R commented 10 years ago

Related to jmorrell/backbone-collection-proxy#2

I've missed this when i opened the previous issue, but Obscura took its events from an internally created collection and not from its superset.

I'd happily open a PR for this, but for now i'm not sure about how to tackle this cleanly.

jmorrell commented 10 years ago

Hmm... good point. I think the only way to do this is to make sure the underlying collections (filtered, sorted, paginated) pass on those events. I agree that they should, since there's an obvious use case.

If you want to try, I'm happy to approve PRs on the three libraries. If not, I'll try to get it done in the next couple of days.

Florian-R commented 10 years ago

Thanks for your attention. Pretty busy ATM, but i'll try do give it a shot in the middle of the week.

Florian-R commented 10 years ago

Had finally some time to shim on this, sorry for the delay.

Curious to know what you'd mean by

I think the only way to do this is to make sure the underlying collections

Something like

this.listenTo(this._collection, 'sync request error', function () {
  this.trigger.apply(this, arguments)
});

in each underlying collection constructor or you had another idea in mind?