diff --git a/changelog.md b/changelog.md index 601d61c..2aa29f2 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,10 @@ # Changelog +## 2024-10-16 - 3.2.3 - fix(smartduplex) +Enhance documentation for read function in SmartDuplex + +- Added inline comments to clarify the behavior and importance of unlocking the reader in the readFunction of SmartDuplex.fromWebReadableStream. + ## 2024-10-16 - 3.2.2 - fix(SmartDuplex) Fix issue with SmartDuplex fromWebReadableStream method diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index 7b6c7c6..5d8e696 100644 --- a/ts/00_commitinfo_data.ts +++ b/ts/00_commitinfo_data.ts @@ -3,6 +3,6 @@ */ export const commitinfo = { name: '@push.rocks/smartstream', - version: '3.2.2', + version: '3.2.3', description: 'A library to simplify the creation and manipulation of Node.js streams, providing utilities for handling transform, duplex, and readable/writable streams effectively in TypeScript.' } diff --git a/ts/smartstream.classes.smartduplex.ts b/ts/smartstream.classes.smartduplex.ts index 689cf09..e6fd54a 100644 --- a/ts/smartstream.classes.smartduplex.ts +++ b/ts/smartstream.classes.smartduplex.ts @@ -56,6 +56,10 @@ export class SmartDuplex extends Duplex { readableStream: ReadableStream ): SmartDuplex { const smartDuplex = new SmartDuplex({ + /** + * this function is called whenever the stream is being read from and at the same time if nothing is enqueued + * therefor it is important to always unlock the reader after reading + */ readFunction: async () => { const reader = readableStream.getReader(); const { value, done } = await reader.read(); diff --git a/ts_web/00_commitinfo_data.ts b/ts_web/00_commitinfo_data.ts index 7b6c7c6..5d8e696 100644 --- a/ts_web/00_commitinfo_data.ts +++ b/ts_web/00_commitinfo_data.ts @@ -3,6 +3,6 @@ */ export const commitinfo = { name: '@push.rocks/smartstream', - version: '3.2.2', + version: '3.2.3', description: 'A library to simplify the creation and manipulation of Node.js streams, providing utilities for handling transform, duplex, and readable/writable streams effectively in TypeScript.' }