Creates a stateful SSE parser that correctly handles data: lines split
across multiple network chunks.
Each call to the returned parse function accepts the next raw text chunk
and returns results for every complete SSE line seen so far. Any incomplete
trailing line is held in an internal buffer and prepended to the next chunk.
Use this instead of calling parseSseChunk directly when reading from a
ReadableStream, where a single data: line may be split across reads.
Creates a stateful SSE parser that correctly handles
data:lines split across multiple network chunks.Each call to the returned
parsefunction accepts the next raw text chunk and returns results for every complete SSE line seen so far. Any incomplete trailing line is held in an internal buffer and prepended to the next chunk.Use this instead of calling
parseSseChunkdirectly when reading from aReadableStream, where a singledata:line may be split across reads.