You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(react-hooks,webapp,core): from/maxRecords/onRecords for useSessionStream
useSessionStream can start at the current tail (from: "latest"), bound the
retained records (maxRecords), and report each throttled batch of records with
their event ids (onRecords, replacing the per-record onRecord). The session SSE
route reads the start-position header and maps it to the S2 tail start, matching
the run-stream path.
Copy file name to clipboardExpand all lines: .changeset/spotty-pillows-visit.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,4 +2,4 @@
2
2
"@trigger.dev/react-hooks": patch
3
3
---
4
4
5
-
Added a `useSessionStream` React hook for reading a session's output or input channel in realtime, with automatic resume from the last record you received.
5
+
Added a `useSessionStream` React hook for reading a session's output or input channel in realtime. It accumulates records with automatic resume from the last record you received, and supports `from: "latest"` (start at the current tail, only new records after you connect), `maxRecords` (keep a bounded number of records in memory), a `lastEventId` resume cursor, and an `onRecords` callback that delivers each throttled batch of records with their event ids.
0 commit comments