refactor & perf: import { noop } from 'lodash-es' across web (#17439)

This commit is contained in:
yusheng chen 2025-04-06 17:56:08 +08:00 • committed by GitHub
commit c05e03fc09
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
87 changed files with 271 additions and 184 deletions

View file

@ -12,6 +12,7 @@ import type { ICurrentWorkspace, LangGeniusVersionResponse, UserProfileResponse
import MaintenanceNotice from '@/app/components/header/maintenance-notice'
import type { SystemFeatures } from '@/types/feature'
import { defaultSystemFeatures } from '@/types/feature'
import { noop } from 'lodash-es'
export type AppContextValue = {
apps: App[]
@ -54,7 +55,7 @@ const initialWorkspaceInfo: ICurrentWorkspace = {
const AppContext = createContext<AppContextValue>({
systemFeatures: defaultSystemFeatures,
apps: [],
mutateApps: () => { },
mutateApps: noop,
userProfile: {
id: '',
name: '',
@ -68,8 +69,8 @@ const AppContext = createContext<AppContextValue>({
isCurrentWorkspaceOwner: false,
isCurrentWorkspaceEditor: false,
isCurrentWorkspaceDatasetOperator: false,
mutateUserProfile: () => { },
mutateCurrentWorkspace: () => { },
mutateUserProfile: noop,
mutateCurrentWorkspace: noop,
pageContainerRef: createRef(),
langeniusVersionInfo: initialLangeniusVersionInfo,
useSelector,