@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 +4 -0
- package/dist/core.cjs +1 -0
- package/dist/core.d.ts +1 -0
- package/dist/core.mjs +1 -1
- package/dist/index.cjs +1 -0
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
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
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
package/dist/index.cjs
CHANGED
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { createStoreFactory } from './core.mjs';
|
|
1
|
+
export { createStoreFactory, unwrapValue } from './core.mjs';
|
package/package.json
CHANGED