I have a Model which in the initialize function I have the following code:
this.listenTo(this, 'change:re change:read', this.patch);
The patch function looks like this:
patch: function(object) {
this.save(object.changed, { patch: true });
},
Elsewhere in my application I may run:
model.set({ re: 1 });
or:
model.set({ read: new Date() });
both of which work perfectly, however when I call:
model.set({ re: 1, read: new Date() });
The patch function gets called twice and there are two round trips to the server. I would like to keep this down to one round trip if possible.
Can anyone help with this one?
Many thanks
David