/
githubmirror
/
nest
Обзор
Документация
Войти
/
githubmirror
/
nest
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
packages/common/interfaces/scope-options.interface.ts
38 строк
971 B
Kamil Myśliwiec
feat(core): add durable providers feature
31 май 2022, 12:03
Не верифицирован
31 май 2022, 12:03
b8652f8
Код
Авторство
О чём код?
/** * @publicApi */ export enum Scope { /** * The provider can be shared across multiple classes. The provider lifetime * is strictly tied to the application lifecycle. Once the application has * bootstrapped, all providers have been instantiated. */ DEFAULT, /** * A new private instance of the provider is instantiated for every use */ TRANSIENT, /** * A new instance is instantiated for each request processing pipeline */ REQUEST, } /** * @publicApi * * @see [Injection Scopes](https://docs.nestjs.com/fundamentals/injection-scopes) */ export interface ScopeOptions { /** * Specifies the lifetime of an injected Provider or Controller. */ scope?: Scope; /** * Flags provider as durable. This flag can be used in combination with custom context id * factory strategy to construct lazy DI subtrees. * * This flag can be used only in conjunction with scope = Scope.REQUEST. */ durable?: boolean; }