Latch
Hierarchy
-
↳
Latch
Table of contents
Constructors
Properties
Methods
Constructors
constructor
new Latch(uid, opts?)
Provides a latch function with cached state
Parameters
| Name | Type | Description |
|---|---|---|
uid | string | A unique identifier the latch |
opts? | Object | A default_state for the latch |
opts.default_state? | boolean | - |
Overrides
Properties
uid
Readonly uid: string
Inherited from
Methods
close
close(): void
Returns
void
Inherited from
off
off(event, handler): any
Parameters
| Name | Type |
|---|---|
event | string |
handler | any |
Returns
any
Inherited from
on
on(event, handler): any
Parameters
| Name | Type |
|---|---|
event | string |
handler | any |
Returns
any
Inherited from
setState
setState(state): void
Set the state of the latch
Parameters
| Name | Type | Description |
|---|---|---|
state | string | number | boolean | The state to set the toggle to |
Returns
void