react-streaming
Advanced tools
Comparing version 0.3.37 to 0.3.38
@@ -22,5 +22,5 @@ export { createBuffer }; | ||
injectToStream: InjectToStream; | ||
onReactWrite: (chunk: unknown) => Promise<void>; | ||
onReactWrite: (chunk: unknown) => void; | ||
onBeforeEnd: () => Promise<void>; | ||
hasStreamEnded: () => boolean; | ||
}; |
@@ -64,8 +64,3 @@ "use strict"; | ||
writePermission = true; | ||
await new Promise((resolve) => { | ||
// We delay flushing because of Rule 1: https://github.com/brillout/react-streaming/tree/main/src#rule-1 | ||
setTimeout(() => { | ||
resolve(flushBuffer()); | ||
}, 0); | ||
}); | ||
await flushBuffer(); | ||
} | ||
@@ -72,0 +67,0 @@ async function onBeforeEnd() { |
@@ -23,6 +23,7 @@ "use strict"; | ||
const writableForReact = new stream_1.Writable({ | ||
async write(chunk, encoding, callback) { | ||
write(chunk, _encoding, callback) { | ||
debug('write'); | ||
if (!writableFromUser.destroyed) { | ||
await onReactWrite(chunk); | ||
// We cannot await inside write() as we cannot make write() async because of Rule 1: https://github.com/brillout/react-streaming/tree/main/src#rule-1 | ||
onReactWrite(chunk); | ||
} | ||
@@ -29,0 +30,0 @@ else { |
@@ -46,3 +46,4 @@ "use strict"; | ||
} | ||
await onReactWrite(value); | ||
// We cannot await inside this while-loop because of Rule 1: https://github.com/brillout/react-streaming/tree/main/src#rule-1 | ||
onReactWrite(value); | ||
} | ||
@@ -49,0 +50,0 @@ clearTimeouts(); |
@@ -5,3 +5,3 @@ "use strict"; | ||
const getGlobalObject_1 = require("./getGlobalObject"); | ||
const PROJECT_VERSION = '0.3.37'; | ||
const PROJECT_VERSION = '0.3.38'; | ||
const projectInfo = { | ||
@@ -8,0 +8,0 @@ projectName: 'react-streaming', |
@@ -22,5 +22,5 @@ export { createBuffer }; | ||
injectToStream: InjectToStream; | ||
onReactWrite: (chunk: unknown) => Promise<void>; | ||
onReactWrite: (chunk: unknown) => void; | ||
onBeforeEnd: () => Promise<void>; | ||
hasStreamEnded: () => boolean; | ||
}; |
@@ -62,8 +62,3 @@ export { createBuffer }; | ||
writePermission = true; | ||
await new Promise((resolve) => { | ||
// We delay flushing because of Rule 1: https://github.com/brillout/react-streaming/tree/main/src#rule-1 | ||
setTimeout(() => { | ||
resolve(flushBuffer()); | ||
}, 0); | ||
}); | ||
await flushBuffer(); | ||
} | ||
@@ -70,0 +65,0 @@ async function onBeforeEnd() { |
@@ -21,6 +21,7 @@ export { createPipeWrapper }; | ||
const writableForReact = new Writable({ | ||
async write(chunk, encoding, callback) { | ||
write(chunk, _encoding, callback) { | ||
debug('write'); | ||
if (!writableFromUser.destroyed) { | ||
await onReactWrite(chunk); | ||
// We cannot await inside write() as we cannot make write() async because of Rule 1: https://github.com/brillout/react-streaming/tree/main/src#rule-1 | ||
onReactWrite(chunk); | ||
} | ||
@@ -27,0 +28,0 @@ else { |
@@ -44,3 +44,4 @@ export { createReadableWrapper }; | ||
} | ||
await onReactWrite(value); | ||
// We cannot await inside this while-loop because of Rule 1: https://github.com/brillout/react-streaming/tree/main/src#rule-1 | ||
onReactWrite(value); | ||
} | ||
@@ -47,0 +48,0 @@ clearTimeouts(); |
export { projectInfo }; | ||
import { getGlobalObject } from './getGlobalObject'; | ||
const PROJECT_VERSION = '0.3.37'; | ||
const PROJECT_VERSION = '0.3.38'; | ||
const projectInfo = { | ||
@@ -5,0 +5,0 @@ projectName: 'react-streaming', |
{ | ||
"name": "react-streaming", | ||
"description": "React 18 Streaming. Full-fledged & Easy.", | ||
"version": "0.3.37", | ||
"version": "0.3.38", | ||
"peerDependencies": { | ||
@@ -6,0 +6,0 @@ "react": ">=18", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
149646
3122
44