1.0.1 • Published 1 year ago
@sarosia/once v1.0.1
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.