-
Notifications
You must be signed in to change notification settings - Fork 0
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
Calendar API homework commit #1 #10
base: main
Are you sure you want to change the base?
Conversation
You can check this code at CodeSandbox with the link |
} | ||
} | ||
|
||
export class Calendar implements AbstractCalendarClasses.AbstractCalendar { |
There was a problem hiding this comment.
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) => { |
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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("Задача номер один", "#важные")); |
There was a problem hiding this comment.
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 = ""; |
There was a problem hiding this comment.
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") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
проверка везде одинаковая, вынеси в функцию валидатор
No description provided.