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.
56 lines (27 loc) • 819 B
Markdown
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [rc-js-util](./rc-js-util.md) > [fpOnce](./rc-js-util.fponce.md)
## fpOnce() function
Creates a function that can be called many times but will run at most once.
**Signature:**
```typescript
export declare function fpOnce<TArgs extends unknown[], TRet>(initialize: (...args: TArgs) => TRet): (...args: TArgs) => TRet;
```
## Parameters
<table><thead><tr><th>
Parameter
</th><th>
Type
</th><th>
Description
</th></tr></thead>
<tbody><tr><td>
initialize
</td><td>
(...args: TArgs) => TRet
</td><td>
</td></tr>
</tbody></table>
**Returns:**
(...args: TArgs) => TRet
## Remarks
See [fpOnce()](./rc-js-util.fponce.md)<!-- -->.