/execute-once

deploy scoped packages to npm

Primary LanguageTypeScript

@hi-matbub/once

A function that executes once, and returns undefined on sequential calls. Learn how to build a scoped package yourself here!

Setup

npm i @hi-matbub/once

Usage

const { executeOnce } = require("@hi-matbub/once");

const once = executeOnce();

for (let i = 0; i < 3; i++){
  console.log(once(() => "Hello, World!"));
}