wireit
Version:
Upgrade your npm scripts to make them smarter and more efficient
24 lines • 609 B
JavaScript
/**
* @license
* Copyright 2022 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
/**
* A cache for values that are asynchronously computed that ensures that we
* will compute the value for each key at most once.
*/
export class AsyncCache {
async getOrCompute(key, compute) {
let result = this.
if (result === undefined) {
result = compute();
this.
}
return result;
}
get values() {
return this.
}
}
//# sourceMappingURL=async-cache.js.map