DEV Community

Discussion on: useAxios : A simple custom hook for calling APIs using axios

Collapse
 
dastasoft profile image
dastasoft

Nice article and well explained! If you want to go further with the hook I always recommend this article of Kent C Dodds about not using booleans for loading

Collapse
 
hey_yogini profile image
Yogini Bende

Yes, that is also a good approach. But, if I am using reducers, I just go with states as reducers help us updating states synchronously.

Collapse
 
dastasoft profile image
dastasoft

Reducers can also be useful when the different states are closely related, although both options are good in this case :)

Some comments have been hidden by the post's author - find out more