Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nick/lesson18 #37

Merged
merged 5 commits into from
Jun 2, 2020
Merged

Nick/lesson18 #37

merged 5 commits into from
Jun 2, 2020

Conversation

nickovchinnikov
Copy link
Owner

No description provided.

Add ts:check to project
Update dependencies && fix audit problem
@@ -85,3 +85,54 @@ export function* strangeZeroOneSequence(length: number) {
}
Copy link
Owner Author

Choose a reason for hiding this comment

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

Так же добавил пару примеров для урока, смешалось немного, блин (

@@ -26,7 +26,7 @@ export class GameSettingsFormState extends React.Component<
player2Symbol: "O",
};

handleSubmit = (ev: React.FormEvent) => {
handleSubmit = (ev: FormEvent) => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

вот тут не понял, а что не так то было?

Copy link
Collaborator

Choose a reason for hiding this comment

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

а, неиспользованная переменная - ясно

@@ -11,4 +13,5 @@ export interface GameSettingsFormResult {

export interface GameSettingsFormProps {
onSubmit: (settings: GameSettingsFormResult) => void;
ref?: MutableRefObject<any>;
Copy link
Collaborator

Choose a reason for hiding this comment

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

на секунду - а зачем это нужно? вернее это вроде не нужно, потому что  ref не пробрасывается в пропсы

Copy link
Owner Author

Choose a reason for hiding this comment

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

Когда не было свойства TS выдавал ошибку, пришлось добавить

new BinaryTree("b", new BinaryTree("c"), new BinaryTree("d")),
new BinaryTree("e")
);
const array = [...tree];
Copy link
Collaborator

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.

Генератор выводит данные в массив, который уже и проверяем.
Иначе jest будет сравнивать шаги генератора, а не его содержимое

private left?: BinaryTree;
private right?: BinaryTree;

constructor(value: string, left?: BinaryTree, right?: BinaryTree) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

constructor(private value: string, private left?: BinaryTree, private right?: BinaryTree) {

и тело конструктора не понадобится

Copy link
Owner Author

Choose a reason for hiding this comment

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

Без конструктора не заводиться (((

Property 'value' has no initializer and is not definitely assigned in the constructor.ts(2564)

Copy link
Collaborator

Copy link
Owner Author

Choose a reason for hiding this comment

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

Принял, понял, не туда посмотрел, спасибо за пояснения

if (this.left) {
yield* this.left;
}
if (this.right) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

не else if ?

Copy link
Owner Author

Choose a reason for hiding this comment

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

Нужно чекнуть параметры отдельно, они заходят по очереди при иницилизации

Comment on lines +18 to +24
"include": [
"src/**/*",
"scripts/**/*"
],
"exclude": [
"node_modules"
]
Copy link
Collaborator

Choose a reason for hiding this comment

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

ох не люблю я эти параметры

@saitonakamura что скажешь?

Copy link
Owner Author

Choose a reason for hiding this comment

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

Я это сделал для того, чтобы можно было запустить проверку, если есть другой вариант, готов изменить

"ts:check": "npx tsc -p tsconfig.json --noEmit"

Copy link
Contributor

Choose a reason for hiding this comment

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

да нормальные параметры, до этого он например пытался babel.config.js компилировать

@nickovchinnikov nickovchinnikov merged commit f2a447c into master Jun 2, 2020
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.

None yet

3 participants