which approach is better in regards to better code
i have a
signUp
function that need the useDispatch redux hook I have defined this function in a useRegister()
hook which is then used in register page the signUp
function is called internally in my useRegister
hook, the question is since i need my useDispatch hook , along with other functions (setLoadingState ,setModalToggle) these funtions set the state of my App do i keep the sign up
function defined in useRegister()
hook or do i define it in another file functions.ts
file and pass the useDispatch , setLoading ,setModalToggle which approach is better and cleaner0 Replies