fix: toggling AppDetailNav causes unnecessary component rerenders (#3718)

This commit is contained in:
legao
2024-04-24 04:07:28 +00:00
committed by GitHub
parent 9eebe9d54e
commit 40e36e9b52
18 changed files with 314 additions and 276 deletions

View File

@@ -1,8 +1,8 @@
import { useContext } from 'react'
import {
create,
useStore as useZustandStore,
} from 'zustand'
import { createStore } from 'zustand/vanilla'
import { debounce } from 'lodash-es'
import type { Viewport } from 'reactflow'
import type {
@@ -70,9 +70,9 @@ type Shape = {
}
export const createWorkflowStore = () => {
return create<Shape>(set => ({
return createStore<Shape>(set => ({
appId: '',
workflowData: undefined,
workflowRunningData: undefined,
setWorkflowRunningData: workflowRunningData => set(() => ({ workflowRunningData })),
historyWorkflowData: undefined,
setHistoryWorkflowData: historyWorkflowData => set(() => ({ historyWorkflowData })),