@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 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
- // React-optimized dispatcher
177
- const dispatch = createReactDispatcher(registry, (error, action) => {
178
- console.error(`Failed to dispatch ${action}:`, error);
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