@motiadev/stream-client-browser 0.5.2-beta.104-780167 → 0.5.2-beta.104-393515
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.
- package/README.md +9 -12
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -27,9 +27,7 @@ npm install @motiadev/stream-client-browser
|
|
|
27
27
|
```typescript
|
|
28
28
|
import { Stream } from '@motiadev/stream-client-browser'
|
|
29
29
|
|
|
30
|
-
const stream = new Stream('wss://your-stream-server'
|
|
31
|
-
console.log('WebSocket connection established!')
|
|
32
|
-
})
|
|
30
|
+
const stream = new Stream('wss://your-stream-server')
|
|
33
31
|
```
|
|
34
32
|
|
|
35
33
|
### 2. Subscribing to an Item Stream
|
|
@@ -163,18 +161,17 @@ All types are exported from `stream.types.ts` for advanced usage and type safety
|
|
|
163
161
|
```typescript
|
|
164
162
|
import { Stream } from '@motiadev/stream-client-browser'
|
|
165
163
|
|
|
166
|
-
const stream = new Stream('wss://example.com'
|
|
167
|
-
|
|
164
|
+
const stream = new Stream('wss://example.com')
|
|
165
|
+
const userSub = stream.subscribeItem<{ id: string; name: string }>('users', 'user-1')
|
|
168
166
|
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
167
|
+
userSub.addChangeListener((user) => {
|
|
168
|
+
// React to user changes
|
|
169
|
+
})
|
|
172
170
|
|
|
173
|
-
|
|
171
|
+
const groupSub = stream.subscribeGroup<{ id: string; name: string }>('users', 'group-1')
|
|
174
172
|
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
})
|
|
173
|
+
groupSub.addChangeListener((users) => {
|
|
174
|
+
// React to group changes
|
|
178
175
|
})
|
|
179
176
|
```
|
|
180
177
|
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@motiadev/stream-client-browser",
|
|
3
3
|
"description": "Motia Stream Client Package – Responsible for managing streams of data.",
|
|
4
|
-
"version": "0.5.2-beta.104-
|
|
4
|
+
"version": "0.5.2-beta.104-393515",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"uuid": "^11.1.0",
|
|
10
|
-
"@motiadev/stream-client": "0.5.2-beta.104-
|
|
10
|
+
"@motiadev/stream-client": "0.5.2-beta.104-393515"
|
|
11
11
|
},
|
|
12
12
|
"devDependencies": {
|
|
13
13
|
"@types/jest": "^29.5.14",
|