DVModuleGlobals extension

A module's own DV.global registry.

The specification gives modules scoped globals and adds no separate dependency-injection primitive: a module's registry is the application's, under the module's namespace. Two modules that each keep a Cart keep two carts, which is what the namespace is for.

An extension rather than a method on DVModule: the registry lives in dartvel_flutter and the module type in dartvel_core, and a core type reaching up into the framework would be the dependency the other way round.

on

Methods

global<T>([T? instance]) → T

Available on DVModule, provided by the DVModuleGlobals extension

Registers instance in this module's namespace, or reads what the module shares.