Skip to content

Conversation

@otus-learning
Copy link
Owner

No description provided.

@github-actions
Copy link

You can check this code at CodeSandbox with the link
https://githubbox.com/otus-learning/otus-learning/tree/homeworkForLection28

}
}

export class Calendar implements AbstractCalendarClasses.AbstractCalendar {

Choose a reason for hiding this comment

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

use namespace, use async/await

src/Calendar.ts Outdated
resolve(record ? record : null);
});

op.then((data) => {

Choose a reason for hiding this comment

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

op.then((data) => data);

src/Calendar.ts Outdated
private _status: string;

constructor(
record: Record | null,

Choose a reason for hiding this comment

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

refactor types

return true;
}
}
return false;

Choose a reason for hiding this comment

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

return property === this._date || property === this._toDo ...

src/Calendar.ts Outdated
tag: string | null,
status: string | null
) {
this._date = date ? date : this._date;

Choose a reason for hiding this comment

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

date ?? this._date = date

src/Calendar.ts Outdated
}

set date(newDate: string) {
this._date = newDate;

Choose a reason for hiding this comment

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

if typeof newDate === 'string'

src/bundle.ts Outdated
(async () => {
const calendar = new CalendarClasses.Calendar();
await calendar.clear();
console.log(await calendar.create("Задача номер один", "#важные"));

Choose a reason for hiding this comment

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

use enum

AbstractCalendarClasses.AbstractRecord,
AbstractCalendarClasses.AbstractInputRecord
{
/*private*/ _id = "";

Choose a reason for hiding this comment

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

а почему закомментировано?

}

set tag(newTag: string) {
if (typeof newTag === "string") {

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.

3 participants