1.2.0 • Published 10 years ago

simplerouter v1.2.0

Weekly downloads
39
License
-
Repository
github
Last release
10 years ago

simplerouter

Yet another client-side js router!

Usage

var router = new Router({
  anchorElement: document.getElementById('anchor'),
  defaultState: { color: 'green' }
});

router.route = state => state.color;

/**
 * @return {Promise} promise that accepts with created view.
 */
router.initView = viewName => {
  var element = document.createElement('div');
  // ... initialize element
  return element;
};

router.start().then(() => {
  router.setState({ color: 'yellow' });  // Go to yellow page.
});
1.2.0

10 years ago

1.1.0

10 years ago

1.0.4

10 years ago

1.0.3

10 years ago

1.0.2

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago

0.1.1

11 years ago

0.1.0

11 years ago