UNPKG

typed-utilities

Version:
19 lines (15 loc) 330 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.useAsync = void 0; const useAsync = async (create, destroy, use) => { const r = await create(); try { return await use(r); } finally { await destroy(r); } }; exports.useAsync = useAsync; //# sourceMappingURL=useAsync.js.map