File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
packages/react-server/src Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ type BunReadableStreamController = ReadableStreamController & {
1313 end ( ) : mixed ,
1414 write ( data : Chunk | BinaryChunk ) : void ,
1515 error ( error : Error ) : void ,
16+ flush ?: ( ) => void ,
1617} ;
1718export type Destination = BunReadableStreamController ;
1819
@@ -25,8 +26,12 @@ export function scheduleWork(callback: () => void) {
2526}
2627
2728export function flushBuffered ( destination : Destination ) {
28- // WHATWG Streams do not yet have a way to flush the underlying
29- // transform streams. https://github.com/whatwg/streams/issues/960
29+ // Bun direct streams provide a flush function.
30+ // If we don't have any more data to send right now.
31+ // Flush whatever is in the buffer to the wire.
32+ if ( typeof destination . flush === 'function' ) {
33+ destination . flush ( ) ;
34+ }
3035}
3136
3237export function beginWriting ( destination : Destination ) { }
You can’t perform that action at this time.
0 commit comments