Skip to content

Commit 861ca94

Browse files
committed
cleanup after rebasing onto reeact refactor
1 parent afd2a3e commit 861ca94

File tree

6 files changed

+16
-424
lines changed

6 files changed

+16
-424
lines changed

lib/sqlsync-react/src/hooks.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export function useSQLSync(): SQLSync {
1818
const value = useContext(SQLSyncContext);
1919
if (!value) {
2020
throw new Error(
21-
"could not find sqlsync context value; please ensure the component is wrapped in a <SqlSyncProvider>",
21+
"could not find sqlsync context value; please ensure the component is wrapped in a <SqlSyncProvider>"
2222
);
2323
}
2424
return value;
@@ -43,7 +43,7 @@ export function createDocHooks<M>(docType: DocType<M>): DocHooks<M> {
4343
const sqlsync = useSQLSync();
4444
return useCallback(
4545
(mutation: M) => sqlsync.mutate(docId, docType, mutation),
46-
[sqlsync, docId, docType],
46+
[sqlsync, docId, docType]
4747
);
4848
};
4949

@@ -55,7 +55,7 @@ export function createDocHooks<M>(docType: DocType<M>): DocHooks<M> {
5555
const sqlsync = useSQLSync();
5656
return useCallback(
5757
(enabled: boolean) => sqlsync.setConnectionEnabled(docId, docType, enabled),
58-
[sqlsync, docId, docType],
58+
[sqlsync, docId, docType]
5959
);
6060
};
6161

@@ -74,7 +74,7 @@ export type QueryState<R> =
7474
export function useQuery<M, R = Row>(
7575
docType: DocType<M>,
7676
docId: DocId,
77-
rawQuery: ParameterizedQuery | string,
77+
rawQuery: ParameterizedQuery | string
7878
): QueryState<R> {
7979
const sqlsync = useSQLSync();
8080
const [state, setState] = useState<QueryState<R>>({ state: "pending" });

lib/sqlsync-solid-js/src/hooks.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
1-
import { ConnectionStatus, DocId } from "@orbitinghail/sqlsync-worker";
1+
import {
2+
ConnectionStatus,
3+
DocId,
4+
DocType,
5+
ParameterizedQuery,
6+
QuerySubscription,
7+
Row,
8+
SQLSync,
9+
normalizeQuery,
10+
pendingPromise,
11+
} from "@orbitinghail/sqlsync-worker";
212
import { Accessor, createEffect, createSignal, onCleanup, useContext } from "solid-js";
313
import { SQLSyncContext } from "./context";
4-
import { ParameterizedQuery, normalizeQuery } from "./sql";
5-
import { DocType, QuerySubscription, Row, SQLSync } from "./sqlsync";
6-
import { pendingPromise } from "./util";
714

815
export function useSQLSync(): Accessor<SQLSync> {
916
const [sqlSync] = useContext(SQLSyncContext);

lib/sqlsync-solid-js/src/index.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
import { SQLSyncProvider } from "./context";
22
import { createDocHooks, useConnectionStatus } from "./hooks";
3-
import { sql } from "./sql";
4-
import { DocType, Row } from "./sqlsync";
5-
import { serializeMutationAsJSON } from "./util";
63

7-
export { SQLSyncProvider, createDocHooks, serializeMutationAsJSON, sql, useConnectionStatus };
8-
export type { DocType, Row };
4+
export { SQLSyncProvider, createDocHooks, useConnectionStatus };
95

106
// eof: this file only exports

lib/sqlsync-solid-js/src/sql.ts

Lines changed: 0 additions & 42 deletions
This file was deleted.

0 commit comments

Comments
 (0)