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.
246 lines (109 loc) • 2.8 kB
Markdown
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [rc-js-util](./rc-js-util.md) > [\_Fp](./rc-js-util._fp.md)
## \_Fp class
Utilities for functional programming.
**Signature:**
```typescript
export declare class _Fp
```
## Properties
<table><thead><tr><th>
Property
</th><th>
Modifiers
</th><th>
Type
</th><th>
Description
</th></tr></thead>
<tbody><tr><td>
[debounce](./rc-js-util._fp.debounce.md)
</td><td>
`static`
`readonly`
</td><td>
typeof fpDebounce
</td><td>
Creates a function that will proxy calls to `functionToProxy` when `wait` time has passed since the last call, using the most recent arguments. Where `immediate` is true, the function immediately proxies the call and will not proxy again until `wait` time passes since the last call.
</td></tr>
<tr><td>
[identity](./rc-js-util._fp.identity.md)
</td><td>
`static`
`readonly`
</td><td>
typeof fpIdentity
</td><td>
Returns the argument.
</td></tr>
<tr><td>
[maybeNewValue](./rc-js-util._fp.maybenewvalue.md)
</td><td>
`static`
`readonly`
</td><td>
typeof fpMaybeNewValue
</td><td>
Returns the newValue if defined, else the old value.
</td></tr>
<tr><td>
[noOp](./rc-js-util._fp.noop.md)
</td><td>
`static`
`readonly`
</td><td>
typeof fpNoOp
</td><td>
Does nothing (intentionally...).
</td></tr>
<tr><td>
[normalizeToNull](./rc-js-util._fp.normalizetonull.md)
</td><td>
`static`
`readonly`
</td><td>
typeof fpNormalizeToNull
</td><td>
Normalizes `undefined` input to `null`<!-- -->.
</td></tr>
<tr><td>
[normalizeToUndefined](./rc-js-util._fp.normalizetoundefined.md)
</td><td>
`static`
`readonly`
</td><td>
typeof fpNormalizeToUndefined
</td><td>
Normalizes `null` input to `undefined`<!-- -->.
</td></tr>
<tr><td>
[once](./rc-js-util._fp.once.md)
</td><td>
`static`
`readonly`
</td><td>
typeof fpOnce
</td><td>
Creates a function that can be called many times but will run at most once.
</td></tr>
<tr><td>
[runWithin](./rc-js-util._fp.runwithin.md)
</td><td>
`static`
`readonly`
</td><td>
typeof fpRunWithin
</td><td>
Runs the `callback` within the `wrapperFunctions`<!-- -->. This is useful for "positional" attributes, like debug labels, lifecycle block scopes etc.
</td></tr>
<tr><td>
[valueOrNull](./rc-js-util._fp.valueornull.md)
</td><td>
`static`
`readonly`
</td><td>
typeof fpValueOrNull
</td><td>
Returns the value if the predicate is true, else null.
</td></tr>
</tbody></table>