Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/monokrome/marionette-appliances
Adds the concept of small modular appliances to MarionetteJS.
https://github.com/monokrome/marionette-appliances
Last synced: 12 days ago
JSON representation
Adds the concept of small modular appliances to MarionetteJS.
- Host: GitHub
- URL: https://github.com/monokrome/marionette-appliances
- Owner: monokrome
- Created: 2013-07-13T01:28:33.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2019-02-05T21:11:49.000Z (almost 6 years ago)
- Last Synced: 2024-10-17T10:18:31.571Z (29 days ago)
- Language: CoffeeScript
- Size: 15.6 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELIST.md
Awesome Lists containing this project
README
marionette-appliances
=====================Adds the concept of small modular appliances to MarionetteJS.
Usage
-----In a simple case where you have a function called require() that can require
JavaScript models, you should be able to simply do the following:class ExampleApplication extends Marionette.ApplianceManager
appliances: [
'example'
]After loading your application, it will attempt the following process:
- Call `require("example/controller")` and expect it to export an object called
`Controller` which extends `Marionette.AppRouter`. If a controller is found,
it will be instantiated and pass your `Application` instance as the
`application` option to the controller. This allows
`this.options.application` to refer to the current application instance for
every appliance controller.If the Controller does not exist, then the next step will be skipped.
- Since we have found a `Controller`, attempt to `require("example/router")`
and expect this to export an object called `Router` which extends
`Marionette.AppRouter`. If the object exists, it will instantiate the
provided `Router` passing the controller instance as the `controller` option.- Restart this process with the next appliance until all appliances have been
created.- Assign all routers to application.routers[applianceName], so that appliances
can communicate with eachother via events or function calls if necessary.This seems very simple, but the structure implied by it provides a set of
conventions which make working with large apps very simple.Why not use Marionette's modules?
---------------------------------They solve a different problem. You could use modules along with this if you
wanted to nest ApplianceManagers.