sheet-router
Advanced tools
Comparing version 3.0.1 to 3.0.2
{ | ||
"name": "sheet-router", | ||
"version": "3.0.1", | ||
"version": "3.0.2", | ||
"description": "Fast, modular client router", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -56,2 +56,13 @@ # sheet-router [![stability][0]][1] | ||
### hash | ||
Interacting with hash changes is often a common fallback scenario for those who don't have support for browser history. Whenever a `hashchange` event is triggered, sheet-router will trigger an update as seen below. However in order to match hash prefixed routes, the `hash-match` module can be used to normalize routes (ex: `#/foo` becomes `/foo`). | ||
```js | ||
const hash = require('sheet-router/hash') | ||
const match = require('hash-match') | ||
hash(function (href) { | ||
router(match(href)) | ||
console.log('hash location changed: ' + href) | ||
}) | ||
``` | ||
### href | ||
@@ -58,0 +69,0 @@ In HTML links are represented with `<a href="">` style tags. Sheet-router can |
15187
10
292
164