Skip to content

Commit

Permalink
refactor(UIFactory): get rid of 'lodash/forEach' usage
Browse files Browse the repository at this point in the history
  • Loading branch information
ma-efremoff committed Oct 17, 2024
1 parent bbee3bd commit 37fb621
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions packages/ui/src/ui/UIFactory/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React from 'react';
import type {Reducer} from 'redux';
import forEach_ from 'lodash/forEach';

import type {DropdownMenuItem} from '@gravity-ui/uikit';
import type {SVGIconData} from '@gravity-ui/uikit/build/esm/components/Icon/types';
Expand Down Expand Up @@ -440,15 +439,8 @@ export interface UIFactory {
// All methods comes from `configureUIFactory` method
const uiFactory: UIFactory = {} as any;

function configureUIFactoryItem<K extends keyof UIFactory>(k: K, redefinition: UIFactory[K]) {
uiFactory[k] = redefinition;
}

export function configureUIFactory(overrides: UIFactory) {
forEach_(overrides, (_v, k) => {
const key = k as keyof UIFactory;
configureUIFactoryItem(key, overrides[key]!);
});
Object.assign(uiFactory, overrides);
}

export default new Proxy(uiFactory, {
Expand Down

0 comments on commit 37fb621

Please sign in to comment.