@dxos/echo-react 0.8.4-main.6fa680abb7 → 0.8.4-main.7996785055
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/lib/neutral/index.mjs.map +2 -2
- package/dist/lib/neutral/meta.json +1 -1
- package/dist/types/src/useQuery.d.ts +2 -0
- package/dist/types/src/useQuery.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -4
- package/src/useObject.test.tsx +6 -6
- package/src/useQuery.ts +2 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/echo-react",
|
|
3
|
-
"version": "0.8.4-main.
|
|
3
|
+
"version": "0.8.4-main.7996785055",
|
|
4
4
|
"description": "React integration for ECHO.",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@effect-atom/atom": "^0.5.1",
|
|
32
32
|
"@effect-atom/atom-react": "^0.5.0",
|
|
33
|
-
"@dxos/echo
|
|
34
|
-
"@dxos/echo": "0.8.4-main.
|
|
33
|
+
"@dxos/echo": "0.8.4-main.7996785055",
|
|
34
|
+
"@dxos/echo-atom": "0.8.4-main.7996785055"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@testing-library/react": "^16.3.0",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"@types/react-dom": "~19.2.3",
|
|
40
40
|
"react": "~19.2.3",
|
|
41
41
|
"react-dom": "~19.2.3",
|
|
42
|
-
"@dxos/echo-db": "0.8.4-main.
|
|
42
|
+
"@dxos/echo-db": "0.8.4-main.7996785055"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
45
|
"react": "~19.2.3"
|
package/src/useObject.test.tsx
CHANGED
|
@@ -63,8 +63,8 @@ describe('useObject', () => {
|
|
|
63
63
|
expect(result.current[0]).toBe('Test');
|
|
64
64
|
|
|
65
65
|
// Update the property via Obj.change
|
|
66
|
-
Obj.change(obj, (
|
|
67
|
-
|
|
66
|
+
Obj.change(obj, (obj) => {
|
|
67
|
+
obj.name = 'Updated';
|
|
68
68
|
});
|
|
69
69
|
|
|
70
70
|
// Wait for reactivity to update
|
|
@@ -85,8 +85,8 @@ describe('useObject', () => {
|
|
|
85
85
|
expect(result.current[0].name).toBe('Test');
|
|
86
86
|
|
|
87
87
|
// Update a property via Obj.change
|
|
88
|
-
Obj.change(obj, (
|
|
89
|
-
|
|
88
|
+
Obj.change(obj, (obj) => {
|
|
89
|
+
obj.name = 'Updated';
|
|
90
90
|
});
|
|
91
91
|
|
|
92
92
|
// Wait for reactivity to update
|
|
@@ -107,8 +107,8 @@ describe('useObject', () => {
|
|
|
107
107
|
expect(result.current[0]).toBe('Test');
|
|
108
108
|
|
|
109
109
|
// Update a different property via Obj.change
|
|
110
|
-
Obj.change(obj, (
|
|
111
|
-
|
|
110
|
+
Obj.change(obj, (obj) => {
|
|
111
|
+
obj.email = 'newemail@example.com';
|
|
112
112
|
});
|
|
113
113
|
|
|
114
114
|
// Wait a bit to ensure no update happens
|
package/src/useQuery.ts
CHANGED
|
@@ -24,6 +24,8 @@ interface UseQueryFn {
|
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
26
|
* Create subscription.
|
|
27
|
+
*
|
|
28
|
+
* @param queryOrFilter - The query or filter to apply. Query is memoized based on the AST. No need to call useMemo.
|
|
27
29
|
*/
|
|
28
30
|
export const useQuery: UseQueryFn = (
|
|
29
31
|
resource: Database.Queryable | undefined,
|