a-dispatcher
v1.0.1
Published
just a simple url dispatcher
Downloads
26
Readme
a-dispatcher
Just a simple url-dispatcher you can use with regex
npm install a-dispatcher --save
import Dispatcher from 'a-dispatcher';
import User from './user-info';
import Edit from './user-info';
const dispatcher = new Dispatcher();
dispatcher.addRoute('^/user', User);
dispatcher.addRoute('^/edit', Edit);
dispatcher.run(location.pathname);