observ-location-hash
Observable interface to the browser hash location
Install
$ npm install --save observ-location-hash
Usage
var ObservHash = require('observ-location-hash')
var hash = ObservHash('/foo')
hash(function (hash) {
})
hash()
hash.set(path)
API
ObservHash([initialHash]) ->
observHash`
Returns an instance of an observHash observable. Optionally pass in an initial value to set the window hash to.
observHash([listener])
-> function
Returns an unlisten function.
listener
Type: function
A function to call with the current path when the hash changes.
observHash.set(path)
-> undefined
Updates window.locaion.hash.
Related
License
MIT © Andrew Joslin