FluidMapLegacy Interface
Legacy map-like API that extends FluidMap, without the get and set methods supplied by legacy map interfaces.
To use, import via @fluidframework/map/legacy.
For more information about our API support guarantees, see here.
This type is "sealed," meaning that code outside of the library defining it should not implement or extend it. Future versions of this type may add members or make typing of readonly members more specific.
Signature
/** @sealed */
export interface FluidMapLegacy<K, V> extends Omit<FluidMap<K, V>, "get" | "set" | "forEach">
Extends: Omit<FluidMap<K, V>, "get" | "set" | "forEach">
Type Parameters
| Parameter | Description |
|---|---|
| K | |
| V |
Methods
| Method | Alerts | Return Type | Description |
|---|---|---|---|
| clear() | Beta | void | Removes all entries from the map. |
| delete(key) | Beta | boolean | Removes the specified element from the map by its key. |
| forEach(callbackfn, thisArg) | Beta | void | Executes the provided function once per each key/value pair in the map. |
| forEach(callbackfn, thisArg) | Beta | void | Executes the provided function once per each key/value pair in the map. |
Method Details
clear
Removes all entries from the map.
For more information about our API support guarantees, see here.
Signature
clear(): void;
delete
Removes the specified element from the map by its key.
For more information about our API support guarantees, see here.
Signature
delete(key: K): boolean;
Parameters
| Parameter | Type | Description |
|---|---|---|
| key | K |
Returns
true if an element existed and has been removed, or false if the element does not exist.
Return type: boolean
forEach
Executes the provided function once per each key/value pair in the map.
For more information about our API support guarantees, see here.
Signature
forEach(callbackfn: (value: V, key: K, map: FluidMap<K, V>) => void, thisArg?: any): void;
Parameters
| Parameter | Modifiers | Type | Description |
|---|---|---|---|
| callbackfn | (value: V, key: K, map: FluidMap<K, V>) => void | ||
| thisArg | optional | any |
forEach
Executes the provided function once per each key/value pair in the map.
For more information about our API support guarantees, see here.
Signature
forEach(callbackfn: (value: V, key: K, map: Map<K, V>) => void, thisArg?: any): void;
Parameters
| Parameter | Modifiers | Type | Description |
|---|---|---|---|
| callbackfn | (value: V, key: K, map: Map<K, V>) => void | ||
| thisArg | optional | any |