ravendb
Version:
RavenDB client for Node.js
18 lines • 395 B
JavaScript
export class Lazy {
_valueFactory;
_value;
constructor(valueFactory) {
this._valueFactory = valueFactory;
}
isValueCreated() {
return !!this._value;
}
async getValue() {
if (this._value) {
return this._value;
}
this._value = this._valueFactory();
return this._value;
}
}
//# sourceMappingURL=Lazy.js.map