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