An open API service indexing awesome lists of open source software.

https://github.com/matthewbub/execute-once

deploy scoped packages to npm
https://github.com/matthewbub/execute-once

Last synced: 2 months ago
JSON representation

deploy scoped packages to npm

Awesome Lists containing this project

README

          

# @hi-matbub/once

A function that executes once, and returns `undefined` on sequential calls. Learn how to build a scoped package yourself [here!](https://javascript.plainenglish.io/publish-a-scoped-package-to-npm-using-typescript-b36f2f7475c9)

## Setup

```sh
npm i @hi-matbub/once
```

## Usage

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

const once = executeOnce();

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