@nxtedition/shared 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +4 -1
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -31,7 +31,10 @@ export async function reader({ sharedState, sharedBuffer }, cb) {
31
31
  const raw = buffer.slice(readPos + 4, readPos + len)
32
32
  readPos += len
33
33
 
34
- await cb(raw)
34
+ const thenable = cb(raw)
35
+ if (thenable?.then && typeof thenable.then === 'function') {
36
+ await thenable
37
+ }
35
38
  }
36
39
 
37
40
  Atomics.store(state, READ_INDEX, readPos)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nxtedition/shared",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "description": "Ring Buffer for NodeJS cross Worker communication",
5
5
  "main": "index.js",
6
6
  "repository": {