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

Investigate removable dependencies (i.e redux) #98

Open
HenrikSZ opened this issue Sep 14, 2024 · 0 comments
Open

Investigate removable dependencies (i.e redux) #98

HenrikSZ opened this issue Sep 14, 2024 · 0 comments
Assignees

Comments

@HenrikSZ
Copy link

HenrikSZ commented Sep 14, 2024

Remove redux and redux toolkit dependencies. Instead use tanstack react-query.

See the overview here: https://tanstack.com/query/latest/docs/framework/react/overview

You can usually create the query hooks like this:

const useEventQuery = () => useQuery({
    queryKey: ['eventsData'],
    queryFn: () => {
      try {
        return await fetchHelper({
           base: 'CMS',
           url,
       });
     } catch (error) {
       console.log(error);
       throw error;
     }
   }
  })

This also includes removing the context / useApi.

@nxabdullah nxabdullah self-assigned this Sep 17, 2024
@nxabdullah nxabdullah changed the title Remove redux dependency Investigate removable dependencies (i.e redux) Sep 29, 2024
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

No branches or pull requests

2 participants