Are you an LLM? You can read better optimized documentation at /documentation/api/react/functions/streamFold.md for this page in Markdown format
ws-asyncapi API / react / streamFold
Function: streamFold()
streamFold<
Item,Acc>(options?):object
Defined in: node_modules/@ws-asyncapi/query-core/dist/index.d.ts:88
Build the { initial, step } fold. Default (no options) keeps only the latest item — O(1), nothing accumulated.
Type Parameters
Item
Item
Acc
Acc
Parameters
options?
StreamReduce<Item, Acc>
Returns
object
initial
initial:
unknown
step
step: (
acc,item) =>unknown
Parameters
acc
unknown
item
Item
Returns
unknown