hg-event-router

1.0.0 • Public • Published

Mercury EventHashRouter

This module attaches HashRouter to the mercury Event Loop system so that when the hash location changes an event is triggered in mecury to modify state and re-render:

example:

var EventRouter = require('hg-event-router');
var state = hg.state({
  title: hg.value('Foo - Home'),
  route: hg.value('#/'),
  events: {
    setRoute: EventRouter()
  }
});
state.events.setRoute(EventRouter.update.bind(null, state));

hg.app(document.body, state, render);  

install:

npm install hg-hash-router

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.0
    3
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.0
    3

Package Sidebar

Install

npm i hg-event-router

Weekly Downloads

2

Version

1.0.0

License

MIT

Last publish

Collaborators

  • twilson63