Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: move dependency to API to useTodoAPI hook #195

Merged
merged 1 commit into from
Mar 13, 2023
Merged

Conversation

olavis
Copy link
Contributor

@olavis olavis commented Mar 9, 2023

Why is this pull request needed?

This pull request is needed because separation of concerns 😄

What does this pull request change?

Moves dependency to api from the jsx-components to the custom hook useTodoAPI. Fetching and state handling were previously nested together in useTodos until state handling got separated in #193. Fetch-logic got temporarily moved to the components that consumed them until this PR.

Issues related to this change:

#193

Copy link
Contributor

@ingeridhellen ingeridhellen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great refactor! And I learned something, too!

web/src/hooks/useTodoAPI.tsx Show resolved Hide resolved
@olavis olavis merged commit 4055f89 into main Mar 13, 2023
@olavis olavis deleted the refactor/api-hook branch March 13, 2023 10:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants