@figliolia/galena 2.2.0 → 2.2.2

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.
@@ -57,7 +57,7 @@ import { Scheduler } from "./Scheduler";
57
57
  * ```
58
58
  */
59
59
  export declare class State<T extends any = any> extends Scheduler {
60
- private state;
60
+ state: T;
61
61
  readonly name: string;
62
62
  readonly initialState: T;
63
63
  private readonly middleware;
@@ -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.getState());
26
+ this.previousState = State_1.State.clone(state.state);
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.2.0",
3
+ "version": "2.2.2",
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",
@@ -60,7 +60,7 @@ import { Scheduler } from "./Scheduler";
60
60
  * ```
61
61
  */
62
62
  export class State<T extends any = any> extends Scheduler {
63
- private state: T;
63
+ public 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.getState());
22
+ this.previousState = State.clone(state.state);
23
23
  }
24
24
 
25
25
  override onUpdate(state: State) {