import * as plugins from './logcontext.plugins.js'; import { AsyncStore } from './logcontext.classes.asyncstore.js'; export class AsyncContext { private context = new plugins.simpleAsyncContext.AsyncContext.Variable(); public store = new AsyncStore(); public runScoped(functionArg: (storeArg: AsyncStore) => Promise) { this.context.run(this.store, async () => { const childStore = new AsyncStore(this.store); functionArg(childStore) }); } }