- Preparing search index...
- The search index is not available
Moirae
Properties
Private
Readonly
_distributer
Private
Readonly
_map
_map: Map<string, T>
Accessors
size
- get size(): number
-
Returns number
Methods
delete
- delete(key: string): void
-
Returns void
get
- get(key: string, defaultValue?: T): T
-
Parameters
-
key: string
-
Optional
defaultValue: T
Returns T
has
- has(key: string): boolean
-
Returns boolean
set
- set(key: string, value: T): void
-
Returns void
subscribe
- subscribe(handlerFn: ((event: {
key: string;
value: T;
}) => void)): string
-
Parameters
-
handlerFn: ((event: {
key: string;
value: T;
}) => void)
-
- (event: {
key: string;
value: T;
}): void
-
Parameters
-
event: {
key: string;
value: T;
}
Returns void
Returns string
unsubscribe
- unsubscribe(id: string): void
-
Returns void
waitGet
- waitGet(key: string, timeout?: number): Promise<T>
-
Parameters
-
key: string
-
timeout: number = 5000
Returns Promise<T>
Remove the specified key from the map