@slimlib/store 1.1.3 → 1.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/README.md CHANGED
@@ -99,6 +99,10 @@ The only exported function. It returns createStore factory (see next) which noti
99
99
 
100
100
  Store factory function that takes initial state and returns proxy object and store tuple. Proxy object ment to be left for actions implementations and store is for subscription for changes.
101
101
 
102
+ #### `unwrapValue(value: T): T`
103
+
104
+ Unwraps potential proxy object and returns plain object if possible or value itself.
105
+
102
106
  #### `Store<T>`
103
107
 
104
108
  ```typescript
package/dist/core.cjs CHANGED
@@ -77,3 +77,4 @@ const createStoreFactory = (notifyAfterCreation) => {
77
77
  };
78
78
 
79
79
  exports.createStoreFactory = createStoreFactory;
80
+ exports.unwrapValue = unwrapValue;
package/dist/core.d.ts CHANGED
@@ -4,4 +4,5 @@ export interface Store<T> {
4
4
  (cb: StoreCallback<T>): UnsubscribeCallback;
5
5
  (): Readonly<T>;
6
6
  }
7
+ export declare const unwrapValue: <T>(value: T) => T;
7
8
  export declare const createStoreFactory: (notifyAfterCreation: boolean) => <T extends object>(object?: T) => [T, Store<T>];
package/dist/core.mjs CHANGED
@@ -72,4 +72,4 @@ const createStoreFactory = (notifyAfterCreation) => {
72
72
  };
73
73
  };
74
74
 
75
- export { createStoreFactory };
75
+ export { createStoreFactory, unwrapValue };
package/dist/index.cjs CHANGED
@@ -7,3 +7,4 @@ var core = require('./core.cjs');
7
7
 
8
8
 
9
9
  exports.createStoreFactory = core.createStoreFactory;
10
+ exports.unwrapValue = core.unwrapValue;
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- export { createStoreFactory } from './core.mjs';
1
+ export { createStoreFactory, unwrapValue } from './core.mjs';
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.1.3",
2
+ "version": "1.2.0",
3
3
  "license": "MIT",
4
4
  "name": "@slimlib/store",
5
5
  "author": "Konstantin Shutkin",