mirror of
https://github.com/langgenius/dify.git
synced 2026-03-25 21:23:51 +08:00
Migrate 172 files from es-toolkit/compat to native es-toolkit. Migrated: - noop → es-toolkit/function - cloneDeep, omit, clone, pick → es-toolkit/object - uniq, intersection → es-toolkit/array - capitalize, camelCase, kebabCase, escape → es-toolkit/string - isEqual → es-toolkit/predicate Kept in compat (API differences): - uniqueId, isEmpty - get, merge, flow, curry, debounce - different APIs - uniqBy, groupBy, intersectionBy - property string support - flatten - undefined handling Benefits: 2-3x faster, smaller bundle Part of #30243 Fixes #30244
26 lines
815 B
TypeScript
26 lines
815 B
TypeScript
import type { InstalledApp } from '@/models/explore'
|
|
import { noop } from 'es-toolkit/function'
|
|
import { createContext } from 'use-context-selector'
|
|
|
|
type IExplore = {
|
|
controlUpdateInstalledApps: number
|
|
setControlUpdateInstalledApps: (controlUpdateInstalledApps: number) => void
|
|
hasEditPermission: boolean
|
|
installedApps: InstalledApp[]
|
|
setInstalledApps: (installedApps: InstalledApp[]) => void
|
|
isFetchingInstalledApps: boolean
|
|
setIsFetchingInstalledApps: (isFetchingInstalledApps: boolean) => void
|
|
}
|
|
|
|
const ExploreContext = createContext<IExplore>({
|
|
controlUpdateInstalledApps: 0,
|
|
setControlUpdateInstalledApps: noop,
|
|
hasEditPermission: false,
|
|
installedApps: [],
|
|
setInstalledApps: noop,
|
|
isFetchingInstalledApps: false,
|
|
setIsFetchingInstalledApps: noop,
|
|
})
|
|
|
|
export default ExploreContext
|