backbone.memento
backbone.memento copied to clipboard
support for using extensions to Backbone.Model
I'm using another Backbone.js plugin which provides an extension of the Backbone.Model class. As a result,
structure instanceof Backbone.Model
is returning false. Which subsequently results in an error when I'm calling model.restore() as memento attempts to call the reset() method which doesn't exist on my Model. This change to include a check for .reset method does work for me.
If there's a better way to do this to provide support for extensions to Backbone.Model, I'd be interested to learn it.