Home Reference Source
import {Hash} from 'tablefilter/src/modules/hash.js'
public class | source

Hash

Manages state via URL hash changes

Constructor Summary

Public Constructor
public

constructor(state: State)

Creates an instance of Hash

Member Summary

Public Members
public

Application event emitter instance

public

State object

Method Summary

Public Methods
public

Release Hash event subscriptions and clear fields

public

init()

Initializes the Hash object

public

parse(hash: String): Object

Converts a URL hash into a state JSON object

public

sync()

Applies current hash state to features

public

update(state: State)

Updates the URL hash based on a state change

Public Constructors

public constructor(state: State) source

Creates an instance of Hash

Params:

NameTypeAttributeDescription
state State

Instance of State

Public Members

public emitter: Emitter source

Application event emitter instance

public state: State source

State object

Public Methods

public destroy() source

Release Hash event subscriptions and clear fields

public init() source

Initializes the Hash object

public parse(hash: String): Object source

Converts a URL hash into a state JSON object

Params:

NameTypeAttributeDescription
hash String

URL hash fragment

Return:

Object

JSON object

public sync() source

Applies current hash state to features

public update(state: State) source

Updates the URL hash based on a state change

Params:

NameTypeAttributeDescription
state State

Instance of State