How to wait for the value from a useAction?
I am using useAction with a server action, but when I call the action it is returning a Promise, how do I wait for the Promise and display the result?
1 Reply
Oh seems like I was supposed to use cache rather than an action, and then I use createAsync calling the cache?
no, personally I needed to use an action because of CORS, but createAsync answers my original question.
oh seems like you can also "use server" in cache
oh you can also do it in an async function and use createResource
I am learning so much!
not sure what the difference between all 3 ways is