@joblist/components - v0.3.4
    Preparing search index...

    Simple Hash Router for client-side routing with URLSearchParams Provides utilities for reading, updating, and listening to hash changes

    Index

    Constructors

    Properties

    _currentParams: any
    listeners: Set<any>

    Methods

    • Get a specific parameter value

      Parameters

      • key: string

        Parameter key

      • defaultValue: string

        Default value if parameter doesn't exist

      Returns string

      Parameter value

    • Add a listener for hash changes

      Parameters

      • callback: Function

        Callback function that receives (newParams, oldParams)

      Returns Function

      Unsubscribe function

    • Remove a specific parameter

      Parameters

      • key: string

        Parameter key to remove

      • replace: boolean = false

        If true, replace current history entry instead of adding new one

      Returns void

    • Set a specific parameter

      Parameters

      • key: string

        Parameter key

      • value: string

        Parameter value

      • replace: boolean = false

        If true, replace current history entry instead of adding new one

      Returns void

    • Update hash parameters (replaces current hash)

      Parameters

      • params: any

        Parameters to set

      • replace: boolean = false

        If true, replace current history entry instead of adding new one

      Returns void

    • Update specific hash parameters (merges with existing)

      Parameters

      • params: any

        Parameters to update

      • replace: boolean = false

        If true, replace current history entry instead of adding new one

      Returns void