Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

rewrite backbone.sync

I'm using backbone.js with websockets and sending data to the server based on events.

Is it possible to design/rewrite Backbone.sync to transport model changes to the server in a normalized way?

Any general examples of this would be great, then I can figure out how to integrate it with my server-side methods.

Thanks!

like image 226
boom Avatar asked Dec 04 '22 07:12

boom


1 Answers

I would start with the documentation and the annotated source for the Backbone.Sync function.

Then, see how the "local storage" module modifies Backbone.Sync to store locally instead of to the server as an example of overriding behavior.

Perhaps, this Stack Overflow Question will also help.

like image 168
Brian Genisio Avatar answered Dec 16 '22 19:12

Brian Genisio