Skip to main content

@microsoft/fast-foundation > newInstanceForScope

newInstanceForScope variable

A decorator that indicates that a new instance should be injected scoped to the container that requested the instance.

Signature:
newInstanceForScope: (key: any) => any

Remarks

This creates a resolver with an instance strategy pointing to the new instance, effectively making this a singleton, scoped to the container or DOM's subtree.