-
Notifications
You must be signed in to change notification settings - Fork 15
Closed
Description
In Backbone, when you do this:
const model = new Backbone.Model();
const collection = new Backbone.Collection.extend({ model: model });
collection.add({ id: 1, foo: false });
// do some other stuff
collection.add({ id: 1, foo: true });
// Final result: [{ id: 1, foo: true }]It will only add a model to the collection once and override its values. Currently mobx-binder will not do that, it would just add the same model twice.
I'm not sure yet if we should build this into mobx-binder. It can be very nice, but it can also be weird black magic.
Maybe specifically for .add() it make sense, but for .fetch() I'd rather do a full reset of the store each time. In most of our Backbone apps we now do collection.fetch({ reset: true }) nearly everywhere, so we could make that the default here.
Needs discussion with @jasperstam and @abzainuddin.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels