core3-utils

@wixc3/common on Github

Home > @wixc3/common > once

once() function

Make a function executable only once, following calls are ignored

Signature:

export declare function once<T extends (...args: any[]) => any>(fn: T): T;

Parameters

Parameter Type Description
fn T

Returns:

T

fn, wrapped to run only upon first execution