()
| 2710 | } |
| 2711 | |
| 2712 | const setupQueryCacheSubscription = () => { |
| 2713 | const { queryCacheSubscriptions } = useDevtoolsSubscriptions() |
| 2714 | const queryCache = createMemo(() => { |
| 2715 | const client = useQueryDevtoolsContext().client |
| 2716 | return client.getQueryCache() |
| 2717 | }) |
| 2718 | |
| 2719 | createEffect(() => { |
| 2720 | const cache = queryCache() |
| 2721 | const unsubscribe = cache.subscribe((event) => { |
| 2722 | batch(() => { |
| 2723 | queryCacheSubscriptions.notify(() => cache, event) |
| 2724 | }) |
| 2725 | }) |
| 2726 | onCleanup(unsubscribe) |
| 2727 | }) |
| 2728 | } |
| 2729 | |
| 2730 | const createSubscribeToQueryCacheBatcher = <T,>( |
| 2731 | callback: ( |
no test coverage detected