Skip to content
Bunshi
GitHub

MoleculeConstructor

MoleculeConstructor: <T> (mol, scope) => T

Type parameters

Parameter
T

A molecule constructor is the function that produces a new instance of a dependency. These functions should be idempotent and not mutate any outside state.

When a constructor calls the mol function, it implicitly created a dependency to the molecule it uses. If it calls the scope function, it implicitly created a dependency to the scope.

Parameters

ParameterType
molMoleculeGetter
scopeScopeGetter

Returns

T

Source

vanilla/molecule.ts:38