reactronic 0.22.205 → 0.22.206
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -2,32 +2,35 @@ import { ObservableObject } from './Hooks';
|
|
|
2
2
|
import { ObjectHolder, ObjectRevision, Patch } from './Data';
|
|
3
3
|
export declare abstract class EditJournal extends ObservableObject {
|
|
4
4
|
abstract capacity: number;
|
|
5
|
+
abstract autoSave: boolean;
|
|
5
6
|
abstract readonly isSaving: boolean;
|
|
6
7
|
abstract readonly edits: ReadonlyArray<Patch>;
|
|
7
8
|
abstract readonly canUndo: boolean;
|
|
8
9
|
abstract readonly canRedo: boolean;
|
|
9
10
|
abstract undo(count?: number): void;
|
|
10
11
|
abstract redo(count?: number): void;
|
|
11
|
-
abstract
|
|
12
|
-
abstract beginSave(): void;
|
|
13
|
-
abstract endSave(success: boolean): void;
|
|
12
|
+
abstract save(): void;
|
|
14
13
|
abstract register(patch: Patch): void;
|
|
15
14
|
static create(): EditJournal;
|
|
16
15
|
}
|
|
17
16
|
export declare class EditJournalImpl extends EditJournal {
|
|
18
17
|
private _capacity;
|
|
18
|
+
private _autoSave;
|
|
19
19
|
private _isSaving;
|
|
20
20
|
private _edits;
|
|
21
21
|
private _position;
|
|
22
22
|
private _saved;
|
|
23
23
|
get capacity(): number;
|
|
24
24
|
set capacity(value: number);
|
|
25
|
+
get autoSave(): boolean;
|
|
26
|
+
set autoSave(value: boolean);
|
|
25
27
|
get isSaving(): boolean;
|
|
26
28
|
get edits(): ReadonlyArray<Patch>;
|
|
27
29
|
get canUndo(): boolean;
|
|
28
30
|
get canRedo(): boolean;
|
|
29
31
|
undo(count?: number): void;
|
|
30
32
|
redo(count?: number): void;
|
|
33
|
+
save(): void;
|
|
31
34
|
getUnsaved(): Patch | undefined;
|
|
32
35
|
beginSave(): void;
|
|
33
36
|
endSave(success: boolean): void;
|
|
@@ -14,6 +14,7 @@ class EditJournalImpl extends EditJournal {
|
|
|
14
14
|
constructor() {
|
|
15
15
|
super(...arguments);
|
|
16
16
|
this._capacity = 5;
|
|
17
|
+
this._autoSave = false;
|
|
17
18
|
this._isSaving = false;
|
|
18
19
|
this._edits = [];
|
|
19
20
|
this._position = 0;
|
|
@@ -22,6 +23,8 @@ class EditJournalImpl extends EditJournal {
|
|
|
22
23
|
get capacity() { return this._capacity; }
|
|
23
24
|
set capacity(value) { this._capacity = value; if (value < this._edits.length)
|
|
24
25
|
this._edits.splice(0, this._edits.length - value); }
|
|
26
|
+
get autoSave() { return this._autoSave; }
|
|
27
|
+
set autoSave(value) { this._autoSave = value; }
|
|
25
28
|
get isSaving() { return this._isSaving; }
|
|
26
29
|
get edits() { return this._edits; }
|
|
27
30
|
get canUndo() { return this._edits.length > 0 && this._position > 0; }
|
|
@@ -48,6 +51,8 @@ class EditJournalImpl extends EditJournal {
|
|
|
48
51
|
this._position = i;
|
|
49
52
|
});
|
|
50
53
|
}
|
|
54
|
+
save() {
|
|
55
|
+
}
|
|
51
56
|
getUnsaved() {
|
|
52
57
|
let result = undefined;
|
|
53
58
|
const length = Math.abs(this._position - this._saved);
|
|
@@ -532,12 +532,6 @@ class Operation extends Data_1.Observable {
|
|
|
532
532
|
}
|
|
533
533
|
}
|
|
534
534
|
else if (curr instanceof Data_1.Observable && curr.observers) {
|
|
535
|
-
curr.observers.forEach(o => {
|
|
536
|
-
o.observables.delete(curr);
|
|
537
|
-
if (Dbg_1.Log.isOn && Dbg_1.Log.opt.read)
|
|
538
|
-
Dbg_1.Log.write(Dbg_1.Log.opt.transaction && !Snapshot_1.Snapshot.current().sealed ? '║' : ' ', '-', `${o.hint()} is unsubscribed from own-changed ${Snapshot_1.Dump.rev(r, m)}`);
|
|
539
|
-
});
|
|
540
|
-
curr.observers = undefined;
|
|
541
535
|
}
|
|
542
536
|
}
|
|
543
537
|
static enqueueReactionsToRun(reactions) {
|