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
parent 7016ccef10
commit c05e03fc09
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,
})