If I haven't saved my Backbone Model to local storage (via Backbone.LocalStorage adapter) using the save() method, how come fetch() returns a success callback? Shouldn't it return an error or some other indication that the model is not in fact in local storage?
My model:
var User = Backbone.Model.extend({
initialize: function(){
},
localStorage: new Backbone.LocalStorage("User"),
defaults: {
HANDLE: '',
EMAIL: '',
UUID: '',
USERPIC: '',
TOKENLOGIN: '',
SIGNUPSTATUS: ''
},
});
app.User = new User();
And later, when I fetch it:
app.User.fetch({success:this.userFetchSuccess, error:this.userFetchError});
The callback I get every time is the success callback. Can't imagine why!
Update: Looks like the localStorage adapter may not work properly with Models. See this and this.