@flexbase/store-react
Advanced tools
| import { SubscriptionCallback } from '@flexbase/observable-subject'; | ||
| import { Setter, Store } from '@flexbase/store'; | ||
| /** | ||
| * A hook that attaches a store to a react state | ||
| * A hook that attaches a store to a react state. | ||
| * Internally it uses `useState` and `useEffect` to create a subscription between the store and react state | ||
@@ -9,2 +9,2 @@ * @param store The store to use | ||
| */ | ||
| export declare const useStore: <T>(store: Store<T>, subscribe?: SubscriptionCallback<T> | undefined) => [T | undefined, Setter<T>]; | ||
| export declare const useStore: <T>(store: Store<T>, subscribe?: SubscriptionCallback<T> | undefined) => [T, Setter<T>]; |
| import { Setter, Store } from '@flexbase/store'; | ||
| /** | ||
| * A hook that attaches a store to a react state | ||
| * A hook that attaches a store to a react state. | ||
| * Internally it uses `useState` and `useLayoutEffect` to create a subscription between the store and react state | ||
@@ -8,2 +8,2 @@ * @param store The store to use | ||
| */ | ||
| export declare const useStoreLayout: <T>(store: Store<T>) => [T | undefined, Setter<T>]; | ||
| export declare const useStoreLayout: <T>(store: Store<T>) => [T, Setter<T>]; |
+3
-3
| { | ||
| "name": "@flexbase/store-react", | ||
| "version": "2.1.1", | ||
| "version": "3.0.0", | ||
| "description": "React extensions for @flexbase/store", | ||
@@ -20,4 +20,4 @@ "main": "./dist/index.js", | ||
| "dependencies": { | ||
| "@flexbase/observable-subject": "^2.1.0", | ||
| "@flexbase/store": "^2.0.3" | ||
| "@flexbase/observable-subject": "^2.1.1", | ||
| "@flexbase/store": "^3.0.1" | ||
| }, | ||
@@ -24,0 +24,0 @@ "peerDependencies": { "react": "^18.1.0" }, |
5276
-0.42%+ Added
- Removed
- Removed
Updated