Skip to content
Bunshi
GitHub

createScope

createScope<T>(defaultValue, options?): MoleculeScope< T >

Create a MoleculeScope

A scope tuple is a combination of both a scope key and a scope value. For example, a scope key would be “User” and the scope value would be ”user1@example.com

export const UserScope = createScope("user1")

Type parameters

ParameterDefaultDescription
Tundefinedthe type that this scope provides

Parameters

ParameterTypeDescription
defaultValueT
options?object-
options.debugLabel?string-

Returns

MoleculeScope< T >

a new unique MoleculeScope

Source

scope.ts:36