Make toolsById a shallowRef

A given tool never changes attributes (currently), so no need to track
reactivity for the whole object.
This commit is contained in:
mvdbeek
2024-03-27 10:21:26 +01:00
parent 575806aac4
commit f719222ab3
+2 -2
View File
@@ -4,7 +4,7 @@
import axios from "axios";
import { defineStore } from "pinia";
import Vue, { computed, Ref, ref } from "vue";
import Vue, { computed, Ref, ref, shallowRef } from "vue";
import { createWhooshQuery, filterTools, types_to_icons } from "@/components/Panels/utilities";
import { useUserLocalStorage } from "@/composables/userLocalStorage";
@@ -75,7 +75,7 @@ export interface PanelView {
export const useToolStore = defineStore("toolStore", () => {
const currentPanelView: Ref<string> = useUserLocalStorage("tool-store-view", "");
const defaultPanelView: Ref<string> = ref("");
const toolsById = ref<Record<string, Tool>>({});
const toolsById = shallowRef<Record<string, Tool>>({});
const toolResults = ref<Record<string, string[]>>({});
const panel = ref<Record<string, Record<string, Tool | ToolSection>>>({});
const panelViews = ref<Record<string, PanelView>>({});