@webqit/fetch-plus 0.1.11 → 0.1.12

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/README.md +4 -3
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -236,9 +236,10 @@ Note that `request.port` above is assumed to be injected by the application runt
236
236
 
237
237
  ```js
238
238
  const response = new LiveResponse(await fetch('http://localhost/hello'));
239
+ const { port } = await response.now();
239
240
 
240
- response.port.postMessage('Hello from client');
241
- response.port.addEventListener('message', (event) => {
241
+ port.postMessage('Hello from client');
242
+ port.addEventListener('message', (event) => {
242
243
  console.log(event.data); // Hello from server
243
244
  });
244
245
  ```
@@ -398,7 +399,7 @@ This is done via the `X-Message-Port` header.
398
399
  import { StarPort, WebSocketPort } from '@webqit/port-plus';
399
400
 
400
401
  // Create a port that will contain the ws instance
401
- req.port = new StarPort();
402
+ req.port = new StarPort({ handshake: 1, postAwaitsOpen: true, autoClose: true });
402
403
  const portId = crypto.randomUUID();
403
404
  portRegistry.set(portId, req.port);
404
405
  ```
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  ],
12
12
  "homepage": "https://fetch-plus.netlify.app/",
13
13
  "icon": "https://webqit.io/icon.svg",
14
- "version": "0.1.11",
14
+ "version": "0.1.12",
15
15
  "license": "MIT",
16
16
  "repository": {
17
17
  "type": "git",