@threadplane/angularFunctionv0.3.7

createAgent

Builds the Agent for a session factory. Call it in an injection context; provideAgent does. The agent creates its first session at once, replaces it on each thread switch and disposes the last one when the injection context is destroyed.

When a thread is selected and the session offers load, its saved history is read automatically and isThreadLoading is true meanwhile. A failed read leaves the thread empty.

The agent is registered once for development-install collection: with the registrar the host provides, or else with the page's collector host when one is loaded. Its policy asks the current session's isDevelopmentRuntimeEnabled() each time, and is false for a session without that member. Each session is handed context.developmentRuntime.

import { createAgent } from '@threadplane/angular';

Declaration · overload 1

export declare function createAgent<TSession extends AgentSessionLike>(config: AgentConfig<TSession>): Agent<TSession>;

Type parameters

Parameters

config · required
AgentConfig<TSession>

Returns

Agent<TSession>