@sarosia/once

1.0.1 • Public • Published

once

The simple JavaScript library to call a function once and only once

Usage

To install the module, run

npm i @sarosia/once
const once = require('@sarosia/once');

getCachedObject = once(() => {
  return {};
});

Calling getCachedObject() will create the instance once and always return the same instance.

Readme

Keywords

Package Sidebar

Install

npm i @sarosia/once

Weekly Downloads

2

Version

1.0.1

License

MIT

Unpacked Size

5.19 kB

Total Files

7

Last publish

Collaborators

  • sarosia