Skip to main content
Module

x/momentum/di/scope.ts>Scope

Momentum is an open-source framework for building server-side Deno applications in TypeScript. It provides the paradigms and design patterns to guide developers to create robust, scalable, and enterprise-grade applications.
Latest
enum Scope
import { Scope } from "https://deno.land/x/momentum@v0.8.2/di/scope.ts";

Defines the lifetime of a dependency

Members

Custom

Custom scoped dependencies allow custom named scopes to be defined. The lifetime of dependencies in a custom scoped are controlled by the owner of the scope.

Injection

Injection scoped dependencies are created once per resolve call, and reused within the scope.

This scope is the default.

Request

Request scoped dependencies are created once and reused for the lifetime of a single request.

Singleton

Singleton scoped dependencies are created once and reused for the lifetime of the application

Transient

Transient dependencies are created every time it is needed.