@context-action/core 0.5.0 → 0.7.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/README.md +8 -5
- package/dist/index.cjs +331 -250
- package/dist/index.d.cts +30 -20
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +30 -20
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +332 -249
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -154,7 +154,6 @@ console.log('Success:', result.success);
|
|
|
154
154
|
```typescript
|
|
155
155
|
import {
|
|
156
156
|
useActionHandler,
|
|
157
|
-
createReactDispatcher,
|
|
158
157
|
ReactDevUtils
|
|
159
158
|
} from '@context-action/core';
|
|
160
159
|
|
|
@@ -173,10 +172,14 @@ function MyComponent() {
|
|
|
173
172
|
[] // dependencies
|
|
174
173
|
);
|
|
175
174
|
|
|
176
|
-
//
|
|
177
|
-
const
|
|
178
|
-
|
|
179
|
-
|
|
175
|
+
// Direct registry dispatch with error handling
|
|
176
|
+
const handleDispatch = useCallback(async (action, payload) => {
|
|
177
|
+
try {
|
|
178
|
+
await registry.dispatch(action, payload);
|
|
179
|
+
} catch (error) {
|
|
180
|
+
console.error(`Failed to dispatch ${action}:`, error);
|
|
181
|
+
}
|
|
182
|
+
}, [registry]);
|
|
180
183
|
}
|
|
181
184
|
|
|
182
185
|
// Development utilities
|