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

@ -37,6 +37,7 @@ import {
getMarketplaceListFilterType,
} from './utils'
import { useInstalledPluginList } from '@/service/use-plugins'
import { noop } from 'lodash-es'
export type MarketplaceContextValue = {
intersected: boolean
@ -66,26 +67,26 @@ export type MarketplaceContextValue = {
export const MarketplaceContext = createContext<MarketplaceContextValue>({
intersected: true,
setIntersected: () => {},
setIntersected: noop,
searchPluginText: '',
handleSearchPluginTextChange: () => {},
handleSearchPluginTextChange: noop,
filterPluginTags: [],
handleFilterPluginTagsChange: () => {},
handleFilterPluginTagsChange: noop,
activePluginType: 'all',
handleActivePluginTypeChange: () => {},
handleActivePluginTypeChange: noop,
page: 1,
handlePageChange: () => {},
handlePageChange: noop,
plugins: undefined,
pluginsTotal: 0,
resetPlugins: () => {},
resetPlugins: noop,
sort: DEFAULT_SORT,
handleSortChange: () => {},
handleQueryPlugins: () => {},
handleMoreClick: () => {},
handleSortChange: noop,
handleQueryPlugins: noop,
handleMoreClick: noop,
marketplaceCollectionsFromClient: [],
setMarketplaceCollectionsFromClient: () => {},
setMarketplaceCollectionsFromClient: noop,
marketplaceCollectionPluginsMapFromClient: {},
setMarketplaceCollectionPluginsMapFromClient: () => {},
setMarketplaceCollectionPluginsMapFromClient: noop,
isLoading: false,
isSuccessCollections: false,
})