Marionette Routing
An advanced router for MarionetteJS applications
Features
✓ Nested routes / states / rendering
✓ Handle asynchronous operations
✓ Lazy loading of routes with code splitting
✓ Expose route events through Radio
✓ Implement route context for scoped messaging
✓ API interface semantics similar to MarionetteJS one
✓ Inherits most of Cherrytree features
Installation
$ npm install --save marionette.routing
Requires MarionetteJS v4+, Radio v2+, underscore v1.8+ as peer dependencies
Requires a ES6 Promise implementation attached in window (native or polyfill)
Usage
Define a Route class
;;;
Configure and start the router
;;;;; //create the routerlet router = log: true logError: true // options passed to Cherrytree '#main' // the element / Marionette Region where the root routes will be rendered; //define the routesrouter; //start listening to URL changesrouter; //listen to events using RadioRadio
Documentation
- API
- Guides
Examples
- Contact Manager Fully functional example. Read the tutorial
- Marionette Wires Revisited
Related Projects
- Cherrytree — The router library used by Marionette Routing under the hood
License
Copyright © 2016 Luiz Américo Pereira Câmara. This source code is licensed under the MIT license found in the LICENSE.txt file. The documentation to the project is licensed under the CC BY-SA 4.0 license.