LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
LangGraph
  • Web
  • Channels
  • Pregel
  • Prebuilt
  • Remote
React SDK
Vue SDK
Svelte SDK
Angular SDK
LangGraph SDK
  • Ui
  • Client
  • Auth
  • React
  • Logging
  • React Ui
  • Utils
  • Server
  • Stream
LangGraph Checkpoint
LangGraph Checkpoint MongoDB
LangGraph Checkpoint Postgres
  • Store
LangGraph Checkpoint Redis
  • Shallow
  • Store
LangGraph Checkpoint SQLite
LangGraph Checkpoint Validation
  • Cli
LangGraph API
LangGraph CLI
LangGraph CUA
  • Utils
LangGraph Supervisor
LangGraph Swarm
⌘I

LangChain Assistant

Ask a question to get started

Enter to send•Shift+Enter new line

Menu

LangGraph
WebChannelsPregelPrebuiltRemote
React SDK
Vue SDK
Svelte SDK
Angular SDK
LangGraph SDK
UiClientAuthReactLoggingReact UiUtilsServerStream
LangGraph Checkpoint
LangGraph Checkpoint MongoDB
LangGraph Checkpoint Postgres
Store
LangGraph Checkpoint Redis
ShallowStore
LangGraph Checkpoint SQLite
LangGraph Checkpoint Validation
Cli
LangGraph API
LangGraph CLI
LangGraph CUA
Utils
LangGraph Supervisor
LangGraph Swarm
Language
Theme
JavaScript@langchain/angularuseStream
Function●Since v0.1

useStream

Framework-free factory that constructs a StreamController and wraps its stores in Angular Signals. Callers must supply the DestroyRef that owns the controller's lifetime — it's already captured by the public injectStream helper.

Exported for advanced callers (e.g. testing utilities, custom factories) that prefer to manage injection scope themselves.

Copy
useStream<
  T = Record<string, unknown>,
  InterruptType = unknown,
  ConfigurableType extends object = Record<string, unknown>
>(
  options: UseStreamOptions<InferStateType<T>>,
  destroyRef: DestroyRef
): UseStreamReturn<T, InterruptType, ConfigurableType>

Used in Docs

  • AI Elements
  • assistant-ui
  • Branching chat
  • Generative UI
  • Going to production
(3 more not shown)

Parameters

NameTypeDescription
options*UseStreamOptions<InferStateType<T>>
destroyRefDestroyRef
View source on GitHub