Urara-Blog/node_modules/.pnpm-store/v3/files/c7/b178042271bc57489a83cd1d0b2e031481b22532e46bd0b07f944a16a740906a3fb3d5efd30954e91225b85d4fa2122e20fe6528541b841cdd5e5fa440abce
2022-08-14 01:14:53 +08:00

22 lines
587 B
Text

/*
Copyright 2020 Google LLC
Use of this source code is governed by an MIT-style
license that can be found in the LICENSE file or at
https://opensource.org/licenses/MIT.
*/
import '../_version.js';
/**
* A utility method that makes it easier to use `event.waitUntil` with
* async functions and return the result.
*
* @param {ExtendableEvent} event
* @param {Function} asyncFn
* @return {Function}
* @private
*/
function waitUntil(event, asyncFn) {
const returnPromise = asyncFn();
event.waitUntil(returnPromise);
return returnPromise;
}
export { waitUntil };