Skip to main content

Latch

Hierarchy

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new Latch(uid, opts?)

Provides a latch function with cached state

Parameters

NameTypeDescription
uidstringA unique identifier the latch
opts?ObjectA default_state for the latch
opts.default_state?boolean-

Overrides

ControlBlock.constructor

Properties

uid

Readonly uid: string

Inherited from

ControlBlock.uid

Methods

close

close(): void

Returns

void

Inherited from

ControlBlock.close


off

off(event, handler): any

Parameters

NameType
eventstring
handlerany

Returns

any

Inherited from

ControlBlock.off


on

on(event, handler): any

Parameters

NameType
eventstring
handlerany

Returns

any

Inherited from

ControlBlock.on


setState

setState(state): void

Set the state of the latch

Parameters

NameTypeDescription
statestring | number | booleanThe state to set the toggle to

Returns

void