dify/web/features/deployments/store.ts
Stephen Zhou 96bc73e47d
tweaks
2026-04-29 17:38:40 +08:00

20 lines
691 B
TypeScript

import type { DeploymentsStore } from './store/actions'
import { create } from 'zustand'
import { createDeploymentsActions } from './store/actions'
import { initialDeploymentsState } from './store/initial-state'
import { deploymentsSelectors } from './store/selectors'
export const useDeploymentsStore = create<DeploymentsStore>()((...parameters) => ({
...initialDeploymentsState,
...createDeploymentsActions(...parameters),
}))
export const useDeploymentInstance = (appId?: string) => {
return useDeploymentsStore(deploymentsSelectors.instance(appId))
}
export const useDeploymentAppData = (appId?: string) => {
return useDeploymentsStore(deploymentsSelectors.appData(appId))
}