Created
June 6, 2012 18:28
-
-
Save mxriverlynn/2883744 to your computer and use it in GitHub Desktop.
add initializers to marionette module
This file contains 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
// v0.9.0 of Marionettte will strip down the Modules to bare minimums, removing | |
// the ability to add initializers. you can re-add them to your module, as-needed, | |
// by doing this: | |
MyApp.module("Foo", function(Foo, MyApp, Backbone, Marionette){ | |
var initCallbacks = new Marionette.Callbacks(); | |
Foo.addInitializer = function(initializer){ | |
initCallbacks.add(initializer); | |
} | |
Foo.start = function(options){ | |
initCallbacks.run(options, Foo); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment