@lotics/app-sdk 0.81.0 → 0.81.1
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/dist/src/comments.js
CHANGED
|
@@ -18,9 +18,15 @@
|
|
|
18
18
|
* signed-in member: `available` is false, lists stay empty, and a mutation
|
|
19
19
|
* rejects. Check `available` before rendering a composer.
|
|
20
20
|
*
|
|
21
|
-
* Freshness
|
|
22
|
-
*
|
|
23
|
-
*
|
|
21
|
+
* Freshness: SWR-cached, revalidate on focus / reconnect, and an explicit
|
|
22
|
+
* refetch after every mutation — so another viewer's comment appears on the
|
|
23
|
+
* next focus or `refetch()`, not on its own.
|
|
24
|
+
*
|
|
25
|
+
* This is the one read hook that does NOT keep itself current, and the reason
|
|
26
|
+
* is worth knowing rather than guessing: the realtime channel carries **record**
|
|
27
|
+
* changes, and a comment is its own entity that emits no record event. Your
|
|
28
|
+
* QUERIES do get pushed (`docs/data_fetching.md`) — do not read this as "apps
|
|
29
|
+
* have no realtime" and go build a poll.
|
|
24
30
|
*/
|
|
25
31
|
import { useCallback } from "react";
|
|
26
32
|
import useSWR from "swr";
|
|
@@ -297,8 +297,11 @@ updateComment, deleteComment, refetch }`.
|
|
|
297
297
|
member source: the `useMembers` roster (requires the member-access declaration above) or member
|
|
298
298
|
cells in your own data. An unresolvable id should render a fallback (`CommentList` has an
|
|
299
299
|
`unknownMember` label for exactly this).
|
|
300
|
-
- **Freshness:** SWR-cached, revalidates on focus/reconnect
|
|
301
|
-
|
|
300
|
+
- **Freshness:** SWR-cached, revalidates on focus/reconnect, so another viewer's comment appears on
|
|
301
|
+
the next focus or explicit `refetch()` — not on its own. Comments are the one read that does not
|
|
302
|
+
keep itself current, and not because apps lack realtime: the channel carries **record** changes,
|
|
303
|
+
and a comment is its own entity that emits no record event. Your queries DO get pushed
|
|
304
|
+
([data_fetching.md](./data_fetching.md)) — don't read this line as "no push" and build a poll.
|
|
302
305
|
|
|
303
306
|
### Counts
|
|
304
307
|
|