Skip to content

Documentation / @andrew_l/context / runWithContext

Function: runWithContext() ​

runWithContext<T>(fn, isolated): T

Runs a function within the injection context and returns its result. Providers/injections are only accessible inside the callback function.

Type Parameters ​

T ​

T = any

Parameters ​

fn ​

() => T

isolated ​

boolean = false

Do not inject parent providers into this context (Default: false)

Returns ​

T