()
| 2756 | } |
| 2757 | |
| 2758 | const setupMutationCacheSubscription = () => { |
| 2759 | const { mutationCacheSubscriptions } = useDevtoolsSubscriptions() |
| 2760 | const mutationCache = createMemo(() => { |
| 2761 | const client = useQueryDevtoolsContext().client |
| 2762 | return client.getMutationCache() |
| 2763 | }) |
| 2764 | |
| 2765 | createEffect(() => { |
| 2766 | const cache = mutationCache() |
| 2767 | let active = true |
| 2768 | const unsubscribe = cache.subscribe((event) => { |
| 2769 | mutationCacheSubscriptions.notify( |
| 2770 | () => cache, |
| 2771 | event, |
| 2772 | (update) => { |
| 2773 | queueMicrotask(() => { |
| 2774 | if (active) update() |
| 2775 | }) |
| 2776 | }, |
| 2777 | ) |
| 2778 | }) |
| 2779 | onCleanup(() => { |
| 2780 | active = false |
| 2781 | unsubscribe() |
| 2782 | }) |
| 2783 | }) |
| 2784 | } |
| 2785 | |
| 2786 | const createSubscribeToMutationCacheBatcher = <T,>( |
| 2787 | callback: ( |
no test coverage detected