プロパティ名変更

This commit is contained in:
tamaina 2021-12-30 03:42:40 +09:00
parent e60517f53b
commit 24a2fff929
1 changed files with 3 additions and 3 deletions

View File

@ -31,13 +31,13 @@ export class Storage<T extends StateDef> {
public readonly reactiveState = {} as ReactiveState<T>; public readonly reactiveState = {} as ReactiveState<T>;
// 簡易的にキューイングして占有ロックとする // 簡易的にキューイングして占有ロックとする
private nextIdbJob: Promise<any> = Promise.resolve(); private currentIdbJob: Promise<any> = Promise.resolve();
private addIdbSetJob<T>(job: () => Promise<T>) { private addIdbSetJob<T>(job: () => Promise<T>) {
const promise = this.nextIdbJob.then(job, e => { const promise = this.currentIdbJob.then(job, e => {
console.error('Pizzax failed to save data to idb!', e); console.error('Pizzax failed to save data to idb!', e);
return job(); return job();
}); });
this.nextIdbJob = promise; this.currentIdbJob = promise;
return promise; return promise;
} }