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

Chat LangChain

What can I help with?

Enter to send·Shift+Enter new line

Menu

LangGraph
WebChannelsPregelPrebuiltRemoteStream
LangGraph SDK
ClientAuthReactLoggingReact UiServer
LangGraph Checkpoint
LangGraph Checkpoint MongoDB
LangGraph Checkpoint Postgres
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/langgraphchannelsdeltaChannelsToSnapshot
Function●Since v1.4

deltaChannelsToSnapshot

Return the set of DeltaChannel names that should snapshot now.

A channel snapshots when EITHER its accumulated update count reaches snapshotFrequency OR the total supersteps since its last snapshot reaches DELTA_MAX_SUPERSTEPS_SINCE_SNAPSHOT. Given channelVersions, a channel without a version is skipped: it was never written on this branch, so it has nothing to snapshot. Pass undefined on a branch without DELTA_WRITES_VERSIONED, where such a channel can still hold writes and this snapshot is what bounds its walk. Pure predicate, no mutation.

Copy
deltaChannelsToSnapshot(
  channels: Record<string, BaseChannel>,
  countersSinceDeltaSnapshot: Record<string, [number, number]>,
  channelVersions: Record<string, string | number> | undefined
): Set<string>

Parameters

NameTypeDescription
channels*Record<string, BaseChannel>
countersSinceDeltaSnapshot*Record<string, [number, number]>
channelVersions*Record<string, string | number> | undefined
View source on GitHub