File

src/session/widget_id_manager.ts

Description

A widget id manager, to ensure widgets always have their own unique ID one could

Index

Methods

Constructor

constructor(storage: WidgetIdStorage)
Parameters :
Name Type Optional
storage WidgetIdStorage No

Methods

forget
forget(name: string)

Forget an existing widget id.

Parameters :
Name Type Optional Description
name string No

Name of the widget to forget.

Returns : void
id
id(name: string)

Retrieve an ID within the current scope of the window. If the name is already register in the instance manager the existing ID will be returned to resume old state.

Parameters :
Name Type Optional Description
name string No

Name to retrieve an ID for.

Returns : WidgetId
reset
reset()

Reset the manager to its original state.

Returns : void
scopeToPage
scopeToPage(page: string)

Scope the manager to a specific page so that instance ids can be stored under different pages. When switching scopes ids generated under the old page will be cleared.

By default, the scope is set to 'global'.

Parameters :
Name Type Optional Description
page string No

Page to scope too.

Returns : void

results matching ""

    No results matching ""