@threadplane/angularFunctionv0.3.7

provideThreadDirectory

Provides one ThreadDirectoryView, built from a directory factory. Retrieve it in any component with injectThreadDirectory(). Provide it at the application root for an app-wide thread list, or in a component's providers to give that subtree its own.

The view creates its directory through config.createDirectory, so this package depends on no backend. The directory is disposed when the providing injector is destroyed.

Pass the config object when it is known up front, or a () => ThreadDirectoryConfig factory when it depends on injected state: the factory runs once, in an injection context.

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

Declaration · overload 1

export declare function provideThreadDirectory<TDirectory extends ThreadDirectory>(config: ThreadDirectoryConfigInput<TDirectory>): Provider[];

Type parameters

TDirectory
ThreadDirectory

Parameters

config · required
ThreadDirectoryConfigInput<TDirectory>

Returns

Provider[]

Examples

providers: [
  provideThreadDirectory({
    createDirectory: ({ clientOptions, reportOperationFailure }) =>
      createLangGraphThreadDirectory({
        apiUrl,
        clientOptions,
        reportOperationFailure,
      }),
  }),
];