Просмотр исходного кода

impl useCurrentPageYjsAwarenessStateSize

Shun Miyazawa 1 год назад
Родитель
Сommit
da6586ec55
1 измененных файлов с 4 добавлено и 0 удалено
  1. 4 0
      apps/app/src/stores/page.tsx

+ 4 - 0
apps/app/src/stores/page.tsx

@@ -58,6 +58,10 @@ export const useCurrentPageYjsDraft = (initialData?: CurrentPageYjsDraft): SWRRe
   return useSWRStatic<CurrentPageYjsDraft, Error>('currentPageYjsDraft', initialData);
 };
 
+export const useCurrentPageYjsAwarenessStateSize = (initialData?: number): SWRResponse<number, Error> => {
+  return useSWRStatic<number, Error>('currentPageYjsAwarenessStateSize', initialData);
+};
+
 /** "useSWRxCurrentPage" is intended for initial data retrieval only. Use "useSWRMUTxCurrentPage" for revalidation */
 export const useSWRxCurrentPage = (initialData?: IPagePopulatedToShowRevision|null): SWRResponse<IPagePopulatedToShowRevision|null> => {
   const key = 'currentPage';