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

10 lines
215 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(
c => DmCache.hook(c, undefined),
() => DmCache.snapshot()
);
}