Documentation / @zerotal/core / index / withApp
Function: withApp()
withApp<
T>(app,fn):T
Defined in: application/currentApp.ts:71
Run fn with app as the current application for the duration of the call —
and everything it awaits — overriding the process default within this scope.
The override is confined to the async context, so concurrent scopes never leak
into one another.
Type Parameters
T
T
Parameters
app
fn
() => T
Returns
T
Example
// Run a migration against a second app's config without disturbing the default.
await withApp(secondApp, () => secondApp.container.make("db"));