@ontahi/react 1.0.0-alpha.13 → 1.0.0-alpha.15

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.
Files changed (2) hide show
  1. package/README.md +14 -0
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -145,6 +145,20 @@ await completeVisible.executeAsync();
145
145
  The bound invocation always uses the latest render input. Passing the Operation declaration itself
146
146
  keeps the lower-level reusable mutation form, where each execution supplies its input.
147
147
 
148
+ `onSuccess` runs as soon as the invocation succeeds, before semantic query invalidation finishes.
149
+ Use it for UI reactions that should follow the committed result immediately, such as closing a
150
+ confirmation dialog or navigating away:
151
+
152
+ ```tsx
153
+ const removeTodo = useOperation(TodoItem.domain.remove, {
154
+ onSuccess: () => navigate('/todos'),
155
+ });
156
+ ```
157
+
158
+ By contrast, `executeAsync()` settles after affected reads have been invalidated. Await it when the
159
+ next statement requires refreshed query state. An invalidation delay therefore does not postpone
160
+ `onSuccess`, but it can keep the returned Promise pending.
161
+
148
162
  `OntahiGraphProvider` consumes committed semantic metadata from every execution exchange on its
149
163
  Runtime Transport. Every cached `useGraphQuery` retains its canonical `GraphReadRequest` in React
150
164
  Query metadata; after commit, Ontahí compares those Reads with the bounded
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ontahi/react",
3
- "version": "1.0.0-alpha.13",
3
+ "version": "1.0.0-alpha.15",
4
4
  "description": "Non-visual React hooks and bridge adapters for Ontahi applications",
5
5
  "homepage": "https://github.com/javifernandes/ontahi/tree/main/packages/react",
6
6
  "license": "Apache-2.0",
@@ -40,7 +40,7 @@
40
40
  "provenance": true
41
41
  },
42
42
  "dependencies": {
43
- "@ontahi/core": "1.0.0-alpha.13"
43
+ "@ontahi/core": "1.0.0-alpha.15"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@tanstack/react-query": "^5.101.4",