mirror of
https://github.com/langgenius/dify.git
synced 2026-05-13 08:57:28 +08:00
20 lines
691 B
TypeScript
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))
|
|
}
|