Currently, backend calls are scattered directly within the components (blockchain-txs), making the code harder to maintain and reuse. The goal of this issue is to create custom hooks to isolate these calls, ensuring the code is more modular and easier to reuse.
Tasks
Identify all backend calls currently present in the components.
Create custom hooks to encapsulate these calls (e.g., useFetchData, useCreateResource).
Ensure the hooks are reusable and follow best practices for composition.
Replace direct backend calls in the components with the newly created hooks.
Test the components to verify they still function correctly.
Acceptance Criteria
[ ] All backend calls should be encapsulated in custom hooks.
[ ] The hooks should be well-documented and easy to use.
[ ] Existing tests should pass, or new tests should be added if necessary.
[ ] The application’s behavior should remain unchanged.
Additional Notes
Suggest meaningful names for the hooks based on their functionality.
Adding support for loading and error handling within the hooks could be beneficial if not already implemented.
Follow the project’s existing design patterns, if applicable.
If there are any questions, please discuss them in the issue’s comments section.
Isolate Backend Calls Using Custom Hooks
Description
Currently, backend calls are scattered directly within the components (blockchain-txs), making the code harder to maintain and reuse. The goal of this issue is to create custom hooks to isolate these calls, ensuring the code is more modular and easier to reuse.
Tasks
useFetchData
,useCreateResource
).Acceptance Criteria
Additional Notes