Created
September 21, 2012 10:26
-
-
Save phawk/3760801 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // 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" | |
| }); | |
| } | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
a testbed sandbox for localstorage?