Skip to content
This repository has been archived by the owner on Jun 7, 2018. It is now read-only.

router5/router5-listeners

Repository files navigation

npm version Build Status Coverage Status

[DEPRECATED] router5-listeners

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].

How to install

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)

How to use

import { Router5 }     from 'router5';
import listenersPlugin from 'router5-listeners';

const router = new Router5()
    .addNode('home', '/home')
    .usePlugin(listenersPlugin());

API

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)

Contributing

Please read contributing guidelines on router5 repository.

About

Listeners plugin for router5 [DEPRECATED]

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •