Skip to content

Instantly share code, notes, and snippets.

@phawk
Created September 21, 2012 10:26
Show Gist options
  • Select an option

  • Save phawk/3760801 to your computer and use it in GitHub Desktop.

Select an option

Save phawk/3760801 to your computer and use it in GitHub Desktop.
//
// Parent view
//
new SomeView({
sandbox: sandbox
});
//
// SomeView
//
Backbone.View.extend({
initialize: function(args) {
this.sandbox = args.sandbox;
},
triggerEvents: function() {
this.sandbox.trigger("some-view:some-event");
},
useStorage: function() {
this.sandbox.storage.set("key", "value");
},
handleError: function() {
this.sandbox.errorHandler.raise({
"level": "e",
"msg": "Some error"
});
}
});
@alexmcroberts
Copy link
Copy Markdown

a testbed sandbox for localstorage?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment