From version 4 and above of router5, this module is no longer needed and code has been moved to router5 main repo. Refer to http://router5.github.io/docs/migration-4.html for more details.
Listeners plugin for [email protected].
The dist
folder contains:
- AMD bundled (with minifed version) named
router5ListenersPlugin
- Browser module-less bundle (with minified version) adding to the globals
router5ListenersPlugin
- UMD and CommonJs files
Sources are distributed through:
- bower (
bower install router5-listeners
) - npm (
npm install --save router5-listeners
)
import { Router5 } from 'router5';
import listenersPlugin from 'router5-listeners';
const router = new Router5()
.addNode('home', '/home')
.usePlugin(listenersPlugin());
This plugin adds the following methods to your router instance:
addListener(fn)
removeListener(fn)
addNodeListener(nodeName, fn)
removeNodeListener(nodeName, fn)
addRouteListener(routeName, fn)
removeRouteListener(routeName, fn)
Please read contributing guidelines on router5 repository.