@sarosia/once
v1.0.1
Published
The simple JavaScript library to call a function once and only once
Downloads
1
Readme
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.