@collective-intelligence/external-apps-client-sdk-react 0.1.24 → 0.1.25

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 +11 -1
  2. package/package.json +3 -3
package/README.md CHANGED
@@ -125,8 +125,18 @@ without resubscribing. It receives the changes of the topic in batches: one
125
125
  delivery per tab, 250 to 1000 ms after the first pending change, with the
126
126
  latest change of each record.
127
127
 
128
+ Pass `onReset` to the client and refetch every realtime-driven query in it.
129
+ The client calls it when the server cannot replay a gap and once after a
130
+ stream opens without a last event id, the first one of each page included.
131
+ Without `onReset` the client cannot recover from such a gap, so a change can
132
+ be lost.
133
+
128
134
  ```tsx
129
- const realtime = createRealtimeClient({ ticketUrl: "/api/realtime/ticket" })
135
+ // `queryClient` is the QueryClient of your realtime-driven queries.
136
+ const realtime = createRealtimeClient({
137
+ ticketUrl: "/api/realtime/ticket",
138
+ onReset: () => queryClient.invalidateQueries()
139
+ })
130
140
 
131
141
  <RealtimeProvider client={realtime}>
132
142
  <LeadBoard />
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@collective-intelligence/external-apps-client-sdk-react",
3
- "version": "0.1.24",
3
+ "version": "0.1.25",
4
4
  "description": "React bindings for Collective Intelligence external applications.",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -48,7 +48,7 @@
48
48
  "access": "public"
49
49
  },
50
50
  "devDependencies": {
51
- "@collective-intelligence/external-apps-client-sdk": "0.1.24",
51
+ "@collective-intelligence/external-apps-client-sdk": "0.1.25",
52
52
  "@collective-intelligence/ui-react": "0.1.22",
53
53
  "@oxlint/plugins": "1.85.0",
54
54
  "@tanstack/react-router": "1.170.30",
@@ -69,5 +69,5 @@
69
69
  "vite": "8.2.1",
70
70
  "vitest": "4.1.10"
71
71
  },
72
- "gitHead": "5d48a1654c4bd7728d61f97818033d2685d99210"
72
+ "gitHead": "4eeed82307ff83ffaf829862616625243eb4c838"
73
73
  }