Skip to content

Calendar API homework commit #1#10

Open
otus-learning wants to merge 3 commits intomainfrom
homeworkForLection28
Open

Calendar API homework commit #1#10
otus-learning wants to merge 3 commits intomainfrom
homeworkForLection28

Conversation

@otus-learning
Copy link
Copy Markdown
Owner

No description provided.

@github-actions
Copy link
Copy Markdown

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

Comment thread src/Calendar.ts
}
}

export class Calendar implements AbstractCalendarClasses.AbstractCalendar {
Copy link
Copy Markdown

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

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

op.then((data) => {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

Comment thread src/Calendar.ts Outdated
private _status: string;

constructor(
record: Record | null,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

refactor types

Comment thread src/Calendar.ts
return true;
}
}
return false;
Copy link
Copy Markdown

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 ...

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

Choose a reason for hiding this comment

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

date ?? this._date = date

Comment thread src/Calendar.ts Outdated
}

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

Choose a reason for hiding this comment

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

if typeof newDate === 'string'

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

Choose a reason for hiding this comment

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

use enum

Comment thread src/Calendar.ts
AbstractCalendarClasses.AbstractRecord,
AbstractCalendarClasses.AbstractInputRecord
{
/*private*/ _id = "";
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

Comment thread src/Calendar.ts
}

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

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