Skip to main content
Version: Current

default_scope

@rotorsoft/act-root


@rotorsoft/act-root / act/src / default_scope

Function: default_scope()

default_scope(): Scoped

Defined in: libs/act/src/ports.ts:188

The ports bag an Act without ActOptions.scoped runs in: the singleton adapters, read through the same frame a scoped Act uses.

Every Act entering a frame is what keeps its ports its own. Without one, a shared Act called from inside a tenant's handler inherited that tenant's frame and committed to the tenant's store.

The properties are getters on purpose. The adapters are resolved lazily and injected after act().build() in the normal case — store(new PgStore()) in application setup, or a test's beforeEach — so capturing them when the bag is made would pin whatever existed at build time. They read the raw resolvers rather than the public store()/cache(), which consult the frame this bag is and would recurse.

Published for adapter and decorator authors, not for apps.

Returns​

Scoped