zlient 3.2.1 → 3.3.0

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 +6 -2
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -255,11 +255,15 @@ socket.send({ text: 'Hello!' });
255
255
  ```typescript
256
256
  const stream = client.createSSE({
257
257
  path: '/events',
258
- response: z.object({ type: z.string(), value: z.number() }),
258
+ response: {
259
+ message: z.object({ type: z.literal('connected') }),
260
+ time: z.string(),
261
+ },
259
262
  });
260
263
 
261
264
  const sse = stream();
262
- sse.on('message', (data) => console.log(data.value));
265
+ sse.on('message', (data) => console.log(data.type)); // Typed as { type: 'connected' }
266
+ sse.on('time', (data) => console.log(data)); // Typed as string
263
267
  ```
264
268
 
265
269
  ---
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zlient",
3
- "version": "3.2.1",
3
+ "version": "3.3.0",
4
4
  "homepage": "https://emirhangumus.github.io/zlient/",
5
5
  "author": "Emirhan Gümüş",
6
6
  "repository": {