Handle both normal Backbone.sync and socket.io sync
opened this issue · comments
I only have part of my api that is using socket.io. The other part is a pure reset AJAX model. How can I support a normal Backbone fetch but also utilize backbone.iobind for socket.io calls. Since backbone.iobind is overwriting Backbone.sync, it looks to be not possible. Any suggestions?
I've made a fix by returning the original sync if no socket is passed in
(Based off mauron85/backbone.iobind since i also need the requirejs support)
@blairvanderhoof this seems to only work on initial load, subsequent fetches on a normal Backbone.sync collections fail. I added this to my backbone.iosync.js, and it is working for me,
if (false === model.socket) {
return origSync(method, model, options);
}
However, I still have to add a socket: false
property to my regular backbone model.
@corpulent @blairvanderhoof implemented in verison 0.4.8