@tanstack/offline-transactions 1.0.44 → 1.0.45
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/package.json +2 -2
- package/skills/offline/SKILL.md +4 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tanstack/offline-transactions",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.45",
|
|
4
4
|
"description": "Offline-first transaction capabilities for TanStack DB",
|
|
5
5
|
"author": "TanStack",
|
|
6
6
|
"license": "MIT",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"skills"
|
|
53
53
|
],
|
|
54
54
|
"dependencies": {
|
|
55
|
-
"@tanstack/db": "0.7.
|
|
55
|
+
"@tanstack/db": "0.7.2"
|
|
56
56
|
},
|
|
57
57
|
"peerDependencies": {
|
|
58
58
|
"@react-native-community/netinfo": ">=11.0.0",
|
package/skills/offline/SKILL.md
CHANGED
|
@@ -10,7 +10,7 @@ description: >
|
|
|
10
10
|
React Native support via separate entry point.
|
|
11
11
|
type: composition
|
|
12
12
|
library: db
|
|
13
|
-
library_version: '0.6.
|
|
13
|
+
library_version: '0.6.17'
|
|
14
14
|
requires:
|
|
15
15
|
- db-core
|
|
16
16
|
- db-core/mutations-optimistic
|
|
@@ -31,6 +31,7 @@ import {
|
|
|
31
31
|
startOfflineExecutor,
|
|
32
32
|
IndexedDBAdapter,
|
|
33
33
|
} from '@tanstack/offline-transactions'
|
|
34
|
+
import { safeRandomUUID } from '@tanstack/db'
|
|
34
35
|
import { todoCollection } from './collections'
|
|
35
36
|
|
|
36
37
|
const executor = startOfflineExecutor({
|
|
@@ -68,7 +69,7 @@ const tx = executor.createOfflineTransaction({
|
|
|
68
69
|
|
|
69
70
|
// Mutations run inside tx.mutate() — uses ambient transaction context
|
|
70
71
|
tx.mutate(() => {
|
|
71
|
-
todoCollection.insert({ id:
|
|
72
|
+
todoCollection.insert({ id: safeRandomUUID(), text: 'New todo' })
|
|
72
73
|
})
|
|
73
74
|
tx.commit()
|
|
74
75
|
```
|
|
@@ -82,7 +83,7 @@ const addTodo = executor.createOfflineAction({
|
|
|
82
83
|
mutationFnName: 'createTodo',
|
|
83
84
|
onMutate: (variables) => {
|
|
84
85
|
todoCollection.insert({
|
|
85
|
-
id:
|
|
86
|
+
id: safeRandomUUID(),
|
|
86
87
|
text: variables.text,
|
|
87
88
|
})
|
|
88
89
|
},
|