@nice-code/state 0.4.9 → 0.4.10

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/build/index.js CHANGED
@@ -77,6 +77,9 @@ class Store {
77
77
  this.currentState = initialState;
78
78
  }
79
79
  }
80
+ get state() {
81
+ return Object.freeze(this.currentState);
82
+ }
80
83
  _setInternalOptions({ ssr, reactionCreators = [] }) {
81
84
  this.ssr = ssr;
82
85
  this.reactionCreators = reactionCreators;
@@ -124,6 +124,9 @@ class Store {
124
124
  this.currentState = initialState;
125
125
  }
126
126
  }
127
+ get state() {
128
+ return Object.freeze(this.currentState);
129
+ }
127
130
  _setInternalOptions({ ssr, reactionCreators = [] }) {
128
131
  this.ssr = ssr;
129
132
  this.reactionCreators = reactionCreators;
@@ -55,6 +55,7 @@ export declare class Store<S extends object = object> {
55
55
  private reactions;
56
56
  private clientSubscriptions;
57
57
  constructor(initialState: S | (() => S));
58
+ get state(): S;
58
59
  /**
59
60
  * Returns the raw state object contained within this store at this moment.
60
61
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nice-code/state",
3
- "version": "0.4.9",
3
+ "version": "0.4.10",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "exports": {