1.0.2 • Published 8 years ago

observ-location-hash v1.0.2

Weekly downloads
3
License
MIT
Repository
github
Last release
8 years ago

observ-location-hash Build Status

Observable interface to the browser hash location

Install

$ npm install --save observ-location-hash

Usage

var ObservHash = require('observ-location-hash')

var hash = ObservHash('/initial-path')

hash(function (hash) {
  //=> (called on window's hashchange event)
})

hash()
//=> returns current hash, minus '#' character

hash.set(path)
//=> sets current hash

API

ObservHash([initialPath]) -> observHash

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

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago

0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago

0.0.0

8 years ago