repos / starfx

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

commit
549d50a
parent
307ecf0
author
Eric Bower
date
2023-10-13 15:50:32 +0000 UTC
chore: rm references to `saga-query`
11 files changed,  +16, -16
M query/api.test.ts
+1, -1
1@@ -214,7 +214,7 @@ it(tests, "run() from a normal saga", () => {
2       throw new Error("no ctx");
3     }
4     const payload = { name: "/users/:id [GET]", options: { id: "1" } };
5-    expect(ctx.value.action.type).toEqual(`@@saga-query${action1}`);
6+    expect(ctx.value.action.type).toEqual(`@@starfx${action1}`);
7     expect(ctx.value.action.payload).toEqual(payload);
8     expect(ctx.value.name).toEqual("/users/:id [GET]");
9     expect(ctx.value.payload).toEqual({ id: "1" });
M query/api.ts
+1, -1
1@@ -12,7 +12,7 @@ import type { ApiName, SagaQueryApi } from "./api-types.ts";
2  *
3  * @example
4  * ```ts
5- * import { createApi, requestMonitor, fetcher } from 'saga-query';
6+ * import { createApi, requestMonitor, fetcher } from 'starfx';
7  *
8  * const api = createApi();
9  * api.use(requestMonitor());
M query/fetch.test.ts
+2, -2
 1@@ -13,8 +13,8 @@ import { requestMonitor } from "./middleware.ts";
 2 
 3 install();
 4 
 5-const baseUrl = "https://saga-query.com";
 6-const mockUser = { id: "1", email: "test@saga-query.com" };
 7+const baseUrl = "https://starfx.com";
 8+const mockUser = { id: "1", email: "test@starfx.com" };
 9 
10 const delay = (n = 200) =>
11   new Promise((resolve) => {
M query/middleware.ts
+1, -1
1@@ -98,7 +98,7 @@ export function* urlParser<Ctx extends ApiCtx = ApiCtx>(ctx: Ctx, next: Next) {
2  *
3  * @example
4  * ```ts
5- * import { createPipe } from 'saga-query';
6+ * import { createPipe } from 'starfx';
7  *
8  * const thunk = createPipe();
9  * thunk.use(customKey);
M query/pipe.test.ts
+1, -1
1@@ -320,7 +320,7 @@ it(tests, "run() on endpoint action - should run the effect", () => {
2       asserts.assert(acc === "ab");
3       assertLike(curCtx, {
4         action: {
5-          type: `@@saga-query${action1}`,
6+          type: `@@starfx${action1}`,
7           payload: {
8             name: "/users",
9           },
M query/pipe.ts
+1, -1
1@@ -94,7 +94,7 @@ export interface SagaApi<Ctx extends PipeCtx> {
2  *
3  * @example
4  * ```ts
5- * import { createPipe } from 'saga-query';
6+ * import { createPipe } from 'starfx';
7  *
8  * const thunk = createPipe();
9  * thunk.use(function* (ctx, next) {
M query/react.test.ts
+1, -1
1@@ -18,7 +18,7 @@ import { createKey } from "./create-key.ts";
2 
3 const h = React.createElement;
4 
5-const mockUser = { id: "1", email: "test@saga-query.com" };
6+const mockUser = { id: "1", email: "test@starfx.com" };
7 
8 const jsonBlob = (data: any) => {
9   return JSON.stringify(data);
M query/react.ts
+5, -5
 1@@ -44,7 +44,7 @@ interface UseCacheResult<D = any, A extends SagaAction = SagaAction>
 2  *
 3  * @example
 4  * ```ts
 5- * import { useLoader } from 'saga-query/react';
 6+ * import { useLoader } from 'starfx/react';
 7  *
 8  * import { api } from './api';
 9  *
10@@ -76,7 +76,7 @@ export function useLoader<S extends QueryState = QueryState>(
11  *
12  * @example
13  * ```ts
14- * import { useApi } from 'saga-query/react';
15+ * import { useApi } from 'starfx/react';
16  *
17  * import { api } from './api';
18  *
19@@ -120,7 +120,7 @@ export function useApi(action: any): any {
20  *
21  * @example
22  * ```ts
23- * import { useQuery } from 'saga-query/react';
24+ * import { useQuery } from 'starfx/react';
25  *
26  * import { api } from './api';
27  *
28@@ -150,7 +150,7 @@ export function useQuery<P = any, A extends SagaAction = SagaAction<P>>(
29  *
30  * @example
31  * ```ts
32- * import { useCache } from 'saga-query/react';
33+ * import { useCache } from 'starfx/react';
34  *
35  * import { api } from './api';
36  *
37@@ -177,7 +177,7 @@ export function useCache<D = any, A extends SagaAction = SagaAction>(
38  *
39  * @example
40  * ```ts
41- * import { useLoaderSuccess, useApi } from 'saga-query/react';
42+ * import { useLoaderSuccess, useApi } from 'starfx/react';
43  *
44  * import { api } from './api';
45  *
M redux/query.ts
+1, -1
1@@ -35,7 +35,7 @@ export const { selectTable: selectData, selectById: selectDataById } = data
2   .getSelectors((s: any) => s[DATA_NAME] || {});
3 
4 /**
5- * Returns data from the saga-query slice of redux from an action.
6+ * Returns data from the starfx slice of redux from an action.
7  */
8 export const selectDataByName = (
9   s: any,
M redux/supervisor.ts
+1, -1
1@@ -37,7 +37,7 @@ export function poll(
2 
3 /**
4  * timer() will create a cache timer for each `key` inside
5- * of a saga-query api endpoint.  `key` is a hash of the action type and payload.
6+ * of a starfx api endpoint.  `key` is a hash of the action type and payload.
7  *
8  * Why do we want this?  If we have an api endpoint to fetch a single app: `fetchApp({ id: 1 })`
9  * if we don't set a timer per key then all calls to `fetchApp` will be on a timer.
M store/supervisor.ts
+1, -1
1@@ -42,7 +42,7 @@ export function poll(parentTimer: number = 5 * 1000, cancelType?: string) {
2 
3 /**
4  * timer() will create a cache timer for each `key` inside
5- * of a saga-query api endpoint.  `key` is a hash of the action type and payload.
6+ * of a starfx api endpoint.  `key` is a hash of the action type and payload.
7  *
8  * Why do we want this?  If we have an api endpoint to fetch a single app: `fetchApp({ id: 1 })`
9  * if we don't set a timer per key then all calls to `fetchApp` will be on a timer.