@speakableio/core 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -64,7 +64,10 @@ declare const assignmentQueryKeys: {
64
64
  byId: (id: string) => readonly ["assignments", string];
65
65
  list: () => readonly ["assignments", "list"];
66
66
  };
67
- declare function useAssignment(id: string): _tanstack_react_query.UseQueryResult<AssignmentWithId | null, Error>;
67
+ declare function useAssignment({ id, enabled }: {
68
+ id: string;
69
+ enabled?: boolean;
70
+ }): _tanstack_react_query.UseQueryResult<AssignmentWithId | null, Error>;
68
71
 
69
72
  type FsClient = ReturnType<typeof createFsClient>;
70
73
  declare function createFsClient(db: FirebaseInstance, platform: 'web' | 'native'): Promise<{
package/dist/index.d.ts CHANGED
@@ -64,7 +64,10 @@ declare const assignmentQueryKeys: {
64
64
  byId: (id: string) => readonly ["assignments", string];
65
65
  list: () => readonly ["assignments", "list"];
66
66
  };
67
- declare function useAssignment(id: string): _tanstack_react_query.UseQueryResult<AssignmentWithId | null, Error>;
67
+ declare function useAssignment({ id, enabled }: {
68
+ id: string;
69
+ enabled?: boolean;
70
+ }): _tanstack_react_query.UseQueryResult<AssignmentWithId | null, Error>;
68
71
 
69
72
  type FsClient = ReturnType<typeof createFsClient>;
70
73
  declare function createFsClient(db: FirebaseInstance, platform: 'web' | 'native'): Promise<{
package/dist/index.js CHANGED
@@ -19,18 +19,19 @@ var createAssignmentRepo = (db, h) => {
19
19
  };
20
20
  };
21
21
 
22
- // src/domains/assignment/hooks.ts
22
+ // src/domains/assignment/assignment.hooks.ts
23
23
  var _reactquery = require('@tanstack/react-query');
24
24
  var assignmentQueryKeys = {
25
25
  all: ["assignments"],
26
26
  byId: (id) => [...assignmentQueryKeys.all, id],
27
27
  list: () => [...assignmentQueryKeys.all, "list"]
28
28
  };
29
- function useAssignment(id) {
29
+ function useAssignment({ id, enabled = true }) {
30
30
  const { fs } = useFs();
31
31
  return _reactquery.useQuery.call(void 0, {
32
32
  queryKey: assignmentQueryKeys.byId(id),
33
- queryFn: () => fs.assignmentRepo.get(id)
33
+ queryFn: () => fs.assignmentRepo.get(id),
34
+ enabled
34
35
  });
35
36
  }
36
37
 
package/dist/index.mjs CHANGED
@@ -19,18 +19,19 @@ var createAssignmentRepo = (db, h) => {
19
19
  };
20
20
  };
21
21
 
22
- // src/domains/assignment/hooks.ts
22
+ // src/domains/assignment/assignment.hooks.ts
23
23
  import { useQuery } from "@tanstack/react-query";
24
24
  var assignmentQueryKeys = {
25
25
  all: ["assignments"],
26
26
  byId: (id) => [...assignmentQueryKeys.all, id],
27
27
  list: () => [...assignmentQueryKeys.all, "list"]
28
28
  };
29
- function useAssignment(id) {
29
+ function useAssignment({ id, enabled = true }) {
30
30
  const { fs } = useFs();
31
31
  return useQuery({
32
32
  queryKey: assignmentQueryKeys.byId(id),
33
- queryFn: () => fs.assignmentRepo.get(id)
33
+ queryFn: () => fs.assignmentRepo.get(id),
34
+ enabled
34
35
  });
35
36
  }
36
37
 
package/package.json CHANGED
@@ -1,12 +1,18 @@
1
1
  {
2
2
  "name": "@speakableio/core",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/Speakable-io/speakable-core.git"
7
7
  },
8
- "main": "dist/index.cjs",
9
- "module": "dist/index.js",
8
+ "scripts": {
9
+ "build": "tsup src/index.ts --dts --format esm,cjs --splitting",
10
+ "dev": "tsup src/index.ts --watch --dts --format esm,cjs --out-dir dist",
11
+ "test": "vitest"
12
+ },
13
+ "react-native": "dist/index.js",
14
+ "main": "dist/index.js",
15
+ "module": "dist/index.mjs",
10
16
  "devDependencies": {
11
17
  "react": "^18.2.0",
12
18
  "@types/react": "^18",
@@ -36,22 +42,23 @@
36
42
  "@tanstack/react-query": "^5.54.1"
37
43
  },
38
44
  "exports": {
39
- ".": "./dist/index.js"
45
+ ".": {
46
+ "react-native": "./dist/index.js",
47
+ "require": "./dist/index.js",
48
+ "import": "./dist/index.mjs"
49
+ }
40
50
  },
41
51
  "bugs": {
42
52
  "url": "https://github.com/Speakable-io/speakable-core/issues"
43
53
  },
44
54
  "description": "Shared data layer for Speakable web & mobile",
45
- "files": ["dist"],
55
+ "files": [
56
+ "dist"
57
+ ],
46
58
  "homepage": "https://github.com/Speakable-io/speakable-core#readme",
47
59
  "license": "UNLICENSED",
48
60
  "publishConfig": {
49
61
  "access": "restricted"
50
62
  },
51
- "scripts": {
52
- "build": "tsup src/index.ts --dts --format esm,cjs --splitting",
53
- "dev": "tsup src/index.ts --watch --dts --format esm,cjs --out-dir dist",
54
- "test": "vitest"
55
- },
56
63
  "types": "dist/index.d.ts"
57
64
  }