# Class: ContextRegistry
A ContextRegistry is a container for FlowCoreContext instances.
Context instances can be registered and retrieved by ID.
A global instance of the context registry is created by the Flo.w RDF library and exported
as flow. This should be used by client code as the entry point to the Flo.w RDF JavaScript API.
# Hierarchy
- ContextRegistry
# Constructors
# constructor
+ new ContextRegistry(): ContextRegistry
Constructs a new context registry instance.
Returns: ContextRegistry
# Methods
# getContext
▸ getContext<TState>(id?: string): Promise<FlowCoreContext<TState>>
Get the specified Flo.w context.
This method returns a promise that will resolve when the context has been registered.
# Type parameters:
| Name |
|---|
TState |
# Parameters:
| Name | Type | Description |
|---|---|---|
id? | string | Context ID. |
Returns: Promise<FlowCoreContext<TState>>
# initializeContext
▸ initializeContext<TState>(options: ContextConfiguration<TState>): FlowCoreContext<TState>
Initialize a new Flo.w context.
# Type parameters:
| Name |
|---|
TState |
# Parameters:
| Name | Type | Description |
|---|---|---|
options | ContextConfiguration<TState> | Context options. |
Returns: FlowCoreContext<TState>
# uninitializeContext
▸ uninitializeContext(contextId?: string): void
Uninitialize the specified Flo.w context.
# Parameters:
| Name | Type | Default value | Description |
|---|---|---|---|
contextId | string | DEFAULT_CONTEXT_ID | Context ID. |
Returns: void
# Object literals
# defaultOptions
▪ Static defaultOptions: object
# Properties:
| Name | Type | Value |
|---|---|---|
host | string | "https://flow.emu-analytics.net" |
id | string | DEFAULT_CONTEXT_ID |