10 lines
215 B
TypeScript
10 lines
215 B
TypeScript
|
import { DmCache } from "Cache";
|
||
|
import { useSyncExternalStore } from "react";
|
||
|
|
||
|
export function useDmCache() {
|
||
|
return useSyncExternalStore(
|
||
|
c => DmCache.hook(c, undefined),
|
||
|
() => DmCache.snapshot()
|
||
|
);
|
||
|
}
|