foundation-store.registerstore
Home > @genesislcap/foundation-store > registerStore
registerStore() function
Creates a dependency injection key for the store being registered.
Signature:
registerStore: <K extends Key>(Base: Constructable<Store>, name?: string) => import("@microsoft/fast-foundation").InterfaceSymbol<K>
Parameters
|
Parameter |
Type |
Description |
|---|---|---|
|
Base |
Constructable<Store> |
The store fragment class. |
|
name |
string |
(Optional) The name of your store fragment, mostly used for internal logging. |
Returns:
import("@microsoft/fast-foundation").InterfaceSymbol<K>
The created key.
Example
export const TradeEntry = registerStore<TradeEntry>(DefaultTradeEntry, 'TradeEntry');