repos / starfx

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

commit
bd72fb5
parent
71d8a09
author
Eric Bower
date
2023-12-12 16:35:41 +0000 UTC
chore: remove outdated selectors
3 files changed,  +7, -32
M store/mod.ts
+0, -1
1@@ -2,7 +2,6 @@ export * from "./context.ts";
2 export * from "./fx.ts";
3 export * from "./store.ts";
4 export * from "./types.ts";
5-export * from "./selectors.ts";
6 export * from "./query.ts";
7 export * from "./supervisor.ts";
8 export { createSelector } from "../deps.ts";
D store/selectors.ts
+0, -31
 1@@ -1,31 +0,0 @@
 2-import type { IdProp } from "../types.ts";
 3-import type { LoaderOutput } from "./slice/loader.ts";
 4-import type { TableOutput } from "./slice/table.ts";
 5-
 6-export interface QueryState {
 7-  cache: TableOutput<any, any>["initialState"];
 8-  loaders: LoaderOutput<any, any>["initialState"];
 9-}
10-
11-export const selectDataTable = (s: QueryState) => {
12-  return s.cache;
13-};
14-
15-export const selectDataById = (s: QueryState, { id }: { id: IdProp }) => {
16-  return selectDataTable(s)[id];
17-};
18-
19-export const addData = (props: { [key: string]: any }) => {
20-  function addDataState(s: QueryState) {
21-    s.cache = { ...s.cache, ...props };
22-  }
23-  return addDataState;
24-};
25-
26-export const selectLoaders = (s: QueryState) => {
27-  return s.loaders;
28-};
29-
30-export const selectLoaderById = (s: QueryState, { id }: { id: IdProp }) => {
31-  return selectLoaders(s)[id];
32-};
M store/types.ts
+7, -0
 1@@ -1,3 +1,5 @@
 2+import type { LoaderOutput } from "./slice/loader.ts";
 3+import type { TableOutput } from "./slice/table.ts";
 4 import type {
 5   Callable,
 6   Operation,
 7@@ -47,3 +49,8 @@ export interface FxStore<S extends AnyState> {
 8   // deno-lint-ignore no-explicit-any
 9   [Symbol.observable]: () => any;
10 }
11+
12+export interface QueryState {
13+  cache: TableOutput<any, any>["initialState"];
14+  loaders: LoaderOutput<any, any>["initialState"];
15+}