snort/packages/app/src/Hooks/useDmsCache.tsx

10 lines
209 B
TypeScript
Raw Normal View History

2023-03-29 12:10:22 +00:00
import { DmCache } from "Cache";
import { useSyncExternalStore } from "react";
export function useDmCache() {
return useSyncExternalStore(
2023-04-19 12:10:41 +00:00
c => DmCache.hook(c, "*"),
2023-03-29 12:10:22 +00:00
() => DmCache.snapshot()
);
}