scopedCapture<T>(fn: () => Promise<T>, obj: unknown): Promise<T>
Execute an async closure fn, and guarantee that obj will not be garbage-collected, until the promise is resolved.
fn
obj
Execute an async closure
fn, and guarantee thatobjwill not be garbage-collected, until the promise is resolved.