Files
AFFiNE-Mirror/packages/frontend/core
EYHN 3df51a217d feat(core): add use guard hook (#11180)
Previously, we used `useLiveData(guardService.can$())` to get the guard result, but `guardService.can$()` will request the server to revalidate the permission when calling it, will cause additional network requests when re-render.

This pr make a new hook `useGuard` to fix this problem.

And the side effect in `can$` is moved to `revalidateCan()` to make that the subscribe method is pure
2025-03-25 14:15:29 +00:00
..
2024-12-24 15:29:48 +08:00