2023-05-25 16:59:47 +08:00
|
|
|
import { createContext } from 'use-context-selector'
|
2023-06-01 23:19:36 +08:00
|
|
|
import type { InstalledApp } from '@/models/explore'
|
2023-05-25 16:59:47 +08:00
|
|
|
|
|
|
|
type IExplore = {
|
|
|
|
controlUpdateInstalledApps: number
|
|
|
|
setControlUpdateInstalledApps: (controlUpdateInstalledApps: number) => void
|
|
|
|
hasEditPermission: boolean
|
|
|
|
installedApps: InstalledApp[]
|
|
|
|
setInstalledApps: (installedApps: InstalledApp[]) => void
|
|
|
|
}
|
|
|
|
|
|
|
|
const ExploreContext = createContext<IExplore>({
|
|
|
|
controlUpdateInstalledApps: 0,
|
|
|
|
setControlUpdateInstalledApps: () => { },
|
|
|
|
hasEditPermission: false,
|
|
|
|
installedApps: [],
|
|
|
|
setInstalledApps: () => { },
|
|
|
|
})
|
|
|
|
|
|
|
|
export default ExploreContext
|