Skip to content

Commit aa05b9d

Browse files
sjburweb-flow
authored andcommitted
fix: fix tests
1 parent c9a5de2 commit aa05b9d

1 file changed

Lines changed: 12 additions & 12 deletions

File tree

packages/devextreme/js/__internal/scheduler/view_model/m_appointment_data_source.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ interface UpdatedAppointmentKey {
1818
export class AppointmentDataSource {
1919
protected updatedAppointmentKeys: UpdatedAppointmentKey[] = [];
2020

21-
protected dataSource: DataSource | null = null;
21+
protected dataSource!: DataSource;
2222

2323
protected updatedAppointment: SafeAppointment | null = null;
2424

@@ -28,7 +28,7 @@ export class AppointmentDataSource {
2828
}
2929

3030
get keyName(): string {
31-
const store = this.dataSource?.store();
31+
const store = this.dataSource.store();
3232
return store?.key() as string;
3333
}
3434

@@ -37,7 +37,7 @@ export class AppointmentDataSource {
3737
}
3838

3939
private getStoreKey(target: SafeAppointment): unknown {
40-
const store = this.dataSource?.store();
40+
const store = this.dataSource.store();
4141

4242
return store?.keyOf(target);
4343
}
@@ -51,7 +51,7 @@ export class AppointmentDataSource {
5151

5252
private initStoreChangeHandlers(): void {
5353
const { dataSource } = this;
54-
const store = dataSource?.store();
54+
const store = dataSource.store();
5555

5656
if (store) {
5757
store.on(STORE_EVENTS.updating, (key) => {
@@ -67,7 +67,7 @@ export class AppointmentDataSource {
6767
});
6868

6969
store.on(STORE_EVENTS.push, (pushItems) => {
70-
const items = dataSource?.items() ?? [];
70+
const items = dataSource.items();
7171
const keyName = store.key() as string;
7272

7373
pushItems.forEach((pushItem) => {
@@ -87,7 +87,7 @@ export class AppointmentDataSource {
8787
});
8888

8989
// eslint-disable-next-line @typescript-eslint/no-floating-promises
90-
dataSource?.load();
90+
dataSource.load();
9191
});
9292
}
9393
}
@@ -107,7 +107,7 @@ export class AppointmentDataSource {
107107

108108
add(rawAppointment: SafeAppointment): DeferredObj<SafeAppointment> {
109109
// @eslint-disable-next-line
110-
return this.dataSource?.store().insert(rawAppointment)
110+
return this.dataSource.store().insert(rawAppointment)
111111
// @ts-expect-error
112112
.done(() => this.dataSource.load());
113113
}
@@ -117,9 +117,9 @@ export class AppointmentDataSource {
117117
// @ts-expect-error
118118
const d = new Deferred();
119119

120-
this.dataSource?.store().update(key, data)
120+
this.dataSource.store().update(key, data)
121121
// @ts-expect-error
122-
.done((result) => this.dataSource?.load()
122+
.done((result) => this.dataSource.load()
123123
// @ts-expect-error
124124
.done(() => d.resolve(result))
125125
.fail(d.reject))
@@ -130,13 +130,13 @@ export class AppointmentDataSource {
130130

131131
remove(rawAppointment: SafeAppointment): DeferredObj<SafeAppointment | undefined> {
132132
const key = this.getStoreKey(rawAppointment);
133-
return this.dataSource?.store().remove(key)
133+
return this.dataSource.store().remove(key)
134134
// @ts-expect-error
135-
.done(() => this.dataSource?.load());
135+
.done(() => this.dataSource.load());
136136
}
137137

138138
destroy(): void {
139-
const store = this.dataSource?.store();
139+
const store = this.dataSource.store();
140140

141141
if (store) {
142142
store.off(STORE_EVENTS.updating);

0 commit comments

Comments
 (0)