Socket
Socket
Sign inDemoInstall

observ-location-hash

Package Overview
Dependencies
5
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    observ-location-hash

Observable interface to the browser hash location


Version published
Weekly downloads
13
increased by44.44%
Maintainers
1
Install size
84.0 kB
Created
Weekly downloads
 

Readme

Source

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.

License

MIT © Andrew Joslin

Keywords

FAQs

Last updated on 12 Jun 2016

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc