@figliolia/galena 2.1.0 → 2.2.0
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.
package/dist/Galena/State.d.ts
CHANGED
|
@@ -23,7 +23,7 @@ class Logger extends Middleware_1.Middleware {
|
|
|
23
23
|
this.previousState = null;
|
|
24
24
|
}
|
|
25
25
|
onBeforeUpdate(state) {
|
|
26
|
-
this.previousState = State_1.State.clone(state.
|
|
26
|
+
this.previousState = State_1.State.clone(state.getState());
|
|
27
27
|
}
|
|
28
28
|
onUpdate(state) {
|
|
29
29
|
console.log("%cMutation:", "color: rgb(187, 186, 186); font-weight: bold", state.name, "@", this.time);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@figliolia/galena",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.0",
|
|
4
4
|
"description": "A performant state management library supporting mutable state, batched updates, middleware and a rich development API",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
package/src/Galena/State.ts
CHANGED
|
@@ -60,7 +60,7 @@ import { Scheduler } from "./Scheduler";
|
|
|
60
60
|
* ```
|
|
61
61
|
*/
|
|
62
62
|
export class State<T extends any = any> extends Scheduler {
|
|
63
|
-
|
|
63
|
+
private state: T;
|
|
64
64
|
public readonly name: string;
|
|
65
65
|
public readonly initialState: T;
|
|
66
66
|
private readonly middleware: Middleware[] = [];
|
|
@@ -19,7 +19,7 @@ export class Logger extends Middleware {
|
|
|
19
19
|
private previousState: Record<string, any> | null = null;
|
|
20
20
|
|
|
21
21
|
override onBeforeUpdate(state: State) {
|
|
22
|
-
this.previousState = State.clone(state.
|
|
22
|
+
this.previousState = State.clone(state.getState());
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
override onUpdate(state: State) {
|