closeout
API reference

closeout/once

Every export of closeout/once, with its signature and doc comment: once.

once(fn) — a function that runs at most once and returns its first result thereafter (design R5).

import { once } from 'closeout/once';

Functions

once

Wrap fn so it runs at most once.

function once<T extends AnyFunction>(fn: T): T;
ParameterType
fnT

Returns T

On this page