Socket
Socket
Sign inDemoInstall

@ccrpc/hash-manager

Package Overview
Dependencies
0
Maintainers
2
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @ccrpc/hash-manager

Store application state in the URL hash


Version published
Maintainers
2
Install size
6.73 kB
Created

Readme

Source

Hash Manager

Store application state in the URL hash. Hash Manager is designed for use in Stencil components.

Usage

import { Component, Listen, Prop, Watch } from '@stencil/core';
import { hashManager } from '@ccrpc/hash-manager';

@Component({
  tag: 'person',
})
export class Person {
  @Prop() name: string = hashManager.init('name', 'Jane');

  @Listen('hashManagerChange', {target: 'window'})
  updateName(e: CustomEvent) {
    if (e.detail.old.name !== e.detail.new.name) this.name = e.detail.new.name;
  }
  
  @Watch('name')
  nameChanged() {
    hashManager.set('name', this.name);
  }
}

Credits

Hash Manager was developed by Matt Yoder for the Champaign County Regional Planning Commission.

License

Hash Manager is available under the terms of the BSD 3-clause license.

FAQs

Last updated on 04 Feb 2020

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