useMolecule
useMolecule<
T
>(mol
,options
?):T
Get an instance from a MoleculeOrInterface
This will use the implicit scope of the component that calls this hook. If the component is wrapped in a ScopeProvider then that scope will be used here.
Scope can also be provided explicitly to this hook. This is useful when you already have access to an ID or other value that represents scope.
Type parameters
Parameter | Description |
---|---|
T | the type of the molecule or interface, and the type of interface returned |
Parameters
Parameter | Type | Description |
---|---|---|
mol | MoleculeOrInterface < T > | a molecule or interface |
options ? | MoleculeScopeOptions | allows for setting scope explicitly |
Returns
T
a instance provided by the molecule