1.2.0 • Published 9 years ago

simplerouter v1.2.0

Weekly downloads
39
License
-
Repository
github
Last release
9 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

9 years ago

1.1.0

9 years ago

1.0.4

9 years ago

1.0.3

9 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago

0.1.1

10 years ago

0.1.0

10 years ago