can anyone give me a scenario in when to use createresouce : refetch and mutation
i believe i my example on the picture that it should be refetch but it had error then when i try mutation it fixed
2 Replies
createResource returns 2 functions: 1) mutate 2) refetch. Difference is that "mutate" just updates the signal value, like calling "setSignal" (so no http call is made as far as i understood), wheres "refetch" executes last request (http call) that was made again..
most probably you had error in getUserTotal function when it accepts first argument as emty string..
what error did u had when you where calling refetch?
oh thanks. i forgot to take screenshot of the error