@yorkie-js/react 0.6.44 → 0.6.48
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/yorkie-js-react.d.ts +21 -21
- package/dist/yorkie-js-react.es.js +278 -205
- package/dist/yorkie-js-react.es.js.map +1 -1
- package/dist/yorkie-js-react.js +278 -205
- package/dist/yorkie-js-react.js.map +1 -1
- package/package.json +2 -2
|
@@ -88,26 +88,43 @@ export declare function shallowEqual<T>(valueA: T, valueB: T): boolean;
|
|
|
88
88
|
* `useChannel` is a custom hook that returns the channel state.
|
|
89
89
|
* It must be used within a ChannelProvider.
|
|
90
90
|
*
|
|
91
|
-
* @returns An object containing
|
|
91
|
+
* @returns An object containing sessionCount, loading, and error state
|
|
92
92
|
*
|
|
93
93
|
* @example
|
|
94
94
|
* ```tsx
|
|
95
95
|
* function ChatRoom() {
|
|
96
|
-
* const {
|
|
96
|
+
* const { sessionCount, loading, error } = useChannel();
|
|
97
97
|
*
|
|
98
98
|
* if (loading) return <div>Loading...</div>;
|
|
99
99
|
* if (error) return <div>Error: {error.message}</div>;
|
|
100
100
|
*
|
|
101
|
-
* return <div>{
|
|
101
|
+
* return <div>{sessionCount} online</div>;
|
|
102
102
|
* }
|
|
103
103
|
* ```
|
|
104
104
|
*/
|
|
105
105
|
export declare const useChannel: () => {
|
|
106
|
-
|
|
106
|
+
sessionCount: number;
|
|
107
107
|
loading: boolean;
|
|
108
108
|
error: Error | undefined;
|
|
109
109
|
};
|
|
110
110
|
|
|
111
|
+
/**
|
|
112
|
+
* `useChannelSessionCount` is a custom hook that returns only the session count value.
|
|
113
|
+
* It must be used within a ChannelProvider.
|
|
114
|
+
* This is a convenience hook for when you only need the session count.
|
|
115
|
+
*
|
|
116
|
+
* @returns The current online session count
|
|
117
|
+
*
|
|
118
|
+
* @example
|
|
119
|
+
* ```tsx
|
|
120
|
+
* function UserCounter() {
|
|
121
|
+
* const count = useChannelSessionCount();
|
|
122
|
+
* return <span>{count} online</span>;
|
|
123
|
+
* }
|
|
124
|
+
* ```
|
|
125
|
+
*/
|
|
126
|
+
export declare const useChannelSessionCount: () => number;
|
|
127
|
+
|
|
111
128
|
/**
|
|
112
129
|
* `useConnection` is a custom hook that returns the connection status of the document.
|
|
113
130
|
*/
|
|
@@ -120,23 +137,6 @@ export declare const useConnection: () => StreamConnectionStatus;
|
|
|
120
137
|
*/
|
|
121
138
|
export declare function useDocument<R, P extends Indexable = Indexable>(): DocumentContextType<R, P>;
|
|
122
139
|
|
|
123
|
-
/**
|
|
124
|
-
* `usePresenceCount` is a custom hook that returns only the count value.
|
|
125
|
-
* It must be used within a PresenceProvider.
|
|
126
|
-
* This is a convenience hook for when you only need the count.
|
|
127
|
-
*
|
|
128
|
-
* @returns The current online user count
|
|
129
|
-
*
|
|
130
|
-
* @example
|
|
131
|
-
* ```tsx
|
|
132
|
-
* function UserCounter() {
|
|
133
|
-
* const count = usePresenceCount();
|
|
134
|
-
* return <span>{count} users online</span>;
|
|
135
|
-
* }
|
|
136
|
-
* ```
|
|
137
|
-
*/
|
|
138
|
-
export declare const usePresenceCount: () => number;
|
|
139
|
-
|
|
140
140
|
/**
|
|
141
141
|
* `usePresences` is a custom hook that returns the presences of the document.
|
|
142
142
|
*/
|