0.1.3 • Published 4 years ago

based-router v0.1.3

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

based-router

一个简单的路由器

import { create, replace, matchPath } from 'based-router';

create(function(location) {
  if (matchPath(location, '/')) {
    // do something
  } else if (matchPath(location, '/list')) {
    // do something
  } else if (matchPath(location, '/detail/:id')) {
    // do something
  } else {
    // no match
    replace('/');
  }
});
0.1.3

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago

0.0.1

4 years ago

0.0.0

4 years ago