Skip to content

Add info option to updateCurrent, provide with currentChange event #186

Open
@bahrus

Description

@bahrus

Proposal:

export interface AppHistoryUpdateCurrentOptions {
    state: unknown;
}

should allow for an info option:

export interface AppHistoryUpdateCurrentOptions {
    state: unknown;
    info: unknown
}

Correspondingly, the change event should provide that info option in the event:

export declare class AppHistoryCurrentChangeEvent extends Event {
    constructor(type: string, eventInit: AppHistoryCurrentChangeEventInit);

    readonly navigationType: AppHistoryNavigationType | null;
    readonly from: AppHistoryEntry;
    readonly info: unknown
}

Some use cases that come to mind:

  • Be able to indicate which portion of the state changed, for better pinpointing reactive updates
  • Provide information about what prompted the change (for example expand a details tag vs closing it)

Metadata

Metadata

Assignees

No one assigned

    Labels

    additionA proposed addition which could be added later without impacting the rest of the API

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions