Skip to content
Bunshi
GitHub

CreateInjectorProps

CreateInjectorProps: object

Optional properties for creating a MoleculeInjector via createInjector

Type declaration

bindings

bindings?: Bindings

A set of bindings to replace the implemenation of a MoleculeInterface or a Molecule with another Molecule.

Bindings are useful for swapping out implementations of molecules during testing, and for library authors to create shareable molecules that may not have a default implementation


instrumentation

instrumentation?: Instrumentation

Instrumentation to observe the internals of the caches uses in the injector


parent

parent?: MoleculeInjector

Parent injector to inherit molecules and cache from. When a molecule or interface is not found in this injector, it will be looked up in the parent injector. The child injector shares the parent’s cache to preserve singleton behavior.

Source

vanilla/injector.ts:151