repos / starfx

supercharged async flow control library.
git clone https://github.com/neurosnap/starfx.git

commit
bf9eaa4
parent
9f21d7e
author
Eric Bower
date
2024-08-19 15:48:00 +0000 UTC
chore(react): export `useStore` hook
2 files changed,  +6, -0
M deps.ts
+1, -0
1@@ -43,6 +43,7 @@ export {
2   Provider,
3   useDispatch,
4   useSelector,
5+  useStore,
6 } from "https://esm.sh/react-redux@8.0.5?pin=v122";
7 export type {
8   TypedUseSelectorHook,
M react.ts
+5, -0
 1@@ -3,6 +3,7 @@ import {
 2   React,
 3   useDispatch,
 4   useSelector,
 5+  useStore as useReduxStore,
 6 } from "./deps.ts";
 7 import type { AnyState, LoaderState } from "./types.ts";
 8 import type { ThunkAction } from "./query/mod.ts";
 9@@ -68,6 +69,10 @@ export function useSchema<S extends AnyState>() {
10   return useContext(SchemaContext) as FxSchema<S>;
11 }
12 
13+export function useStore<S extends AnyState>() {
14+  return useReduxStore() as FxStore<S>;
15+}
16+
17 /**
18  * useLoader will take an action creator or action itself and return the associated
19  * loader for it.