rc-js-util
Version:
A collection of TS and C++ utilities to help writing performant and correct applications, achieved through strict typing and (removable) invariant checking.
70 lines (33 loc) • 884 B
Markdown
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [rc-js-util](./rc-js-util.md) > [mapDeleteGet](./rc-js-util.mapdeleteget_1.md)
## mapDeleteGet() function
Get the stored value if present, then delete the key.
**Signature:**
```typescript
export declare function mapDeleteGet<TKey extends object, TValue>(map: WeakMap<TKey, TValue>, key: TKey): TValue | undefined;
```
## Parameters
<table><thead><tr><th>
Parameter
</th><th>
Type
</th><th>
Description
</th></tr></thead>
<tbody><tr><td>
map
</td><td>
WeakMap<TKey, TValue>
</td><td>
</td></tr>
<tr><td>
key
</td><td>
TKey
</td><td>
</td></tr>
</tbody></table>
**Returns:**
TValue \| undefined
## Remarks
See [mapDeleteGet()](./rc-js-util.mapdeleteget.md)<!-- -->.