Skip to content

Comments

Dz lesson 18 patterns#9

Open
dmitryplus wants to merge 81 commits intomasterfrom
dz-lesson-18-patterns
Open

Dz lesson 18 patterns#9
dmitryplus wants to merge 81 commits intomasterfrom
dz-lesson-18-patterns

Conversation

@dmitryplus
Copy link
Owner

No description provided.

onChildScaleSizeChange: Dispatch<SetStateAction<ScaleSize>>;
}

export const Button: React.FC<ButtonProps> = ({

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Судя по коду, эта кнопка специфичная, стоит назвать ее так, чтобы было понятно из названия для чего она.
Просто Button вызывает желание использовать ее везде.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

поменял на ChangeScaleButton


export function ComponentWithState() {
const [scaleSize, setScaleSize] = useState<ScaleSize>(1);
const [xhprof, setXhprof] = useState({});

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

не очень понятное имя переменной.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

xhprof - это php профилировщик, в переменную попадает вся его выгрузка. поменял на xhprofData

import { Xhprof } from '../Types';
import { Dispatch, SetStateAction } from 'react';

const rowLimit: number = 100;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Предлагаю сделать DEFAULT_ROW_LIMIT. В функцию передавать rowLimit, чтобы была возможность в программе передавать в функцию другие значения. Тем самым повысится гибкость

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ок. согласен. добавил значение по умолчанию

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants