mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
removed delay from base-store
Signed-off-by: Roman <ixrock@gmail.com>
This commit is contained in:
parent
addc220b9f
commit
2b37fe3cc1
@ -12,7 +12,6 @@ import isEqual from "lodash/isEqual";
|
|||||||
export interface BaseStoreParams<T = any> extends ConfOptions<T> {
|
export interface BaseStoreParams<T = any> extends ConfOptions<T> {
|
||||||
autoLoad?: boolean;
|
autoLoad?: boolean;
|
||||||
syncEnabled?: boolean;
|
syncEnabled?: boolean;
|
||||||
syncDelayMs?: number;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export class BaseStore<T = any> extends Singleton {
|
export class BaseStore<T = any> extends Singleton {
|
||||||
@ -28,7 +27,6 @@ export class BaseStore<T = any> extends Singleton {
|
|||||||
this.params = {
|
this.params = {
|
||||||
autoLoad: false,
|
autoLoad: false,
|
||||||
syncEnabled: true,
|
syncEnabled: true,
|
||||||
syncDelayMs: 100,
|
|
||||||
...params,
|
...params,
|
||||||
}
|
}
|
||||||
this.init();
|
this.init();
|
||||||
@ -75,9 +73,7 @@ export class BaseStore<T = any> extends Singleton {
|
|||||||
|
|
||||||
enableSync() {
|
enableSync() {
|
||||||
this.syncDisposers.push(
|
this.syncDisposers.push(
|
||||||
reaction(() => this.toJSON(), model => this.onModelChange(model), {
|
reaction(() => this.toJSON(), model => this.onModelChange(model)),
|
||||||
delay: this.params.syncDelayMs,
|
|
||||||
}),
|
|
||||||
);
|
);
|
||||||
if (ipcMain) {
|
if (ipcMain) {
|
||||||
const callback = (event: IpcMainEvent, model: T) => {
|
const callback = (event: IpcMainEvent, model: T) => {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user