You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While my memories from reading the docs are still fresh, here are two things I was struggling with yesterday:
I was reading through an example in RTKQ docs section about mutations, which had the following code: updatePost: build.mutation<Post, Partial & Pick<Post, 'id'>>. It wasn't obvious from the generic which of the two parameter types was the type of the data sent to the server, and which of the value returned from the endpoint's thunk. It looked, judging by the name of the function, that the first type parameter to the generic was the return type and the second parameter was the type of the argument of the updatePost function; but it took me a while to locate the section in the docs that would confirm this. It was on a different page altogether.
Reading (or rather, skimming) through the listener middleware page, it was hard to discover the full list of functions exposed by the listenerApi. Re-reading this page now, I realize that I made a mistake — I assumed that the functions takeLatest or takeLeading mentioned in the beginning of the page were the part of the exposed api; searched for them in the page, and didn't find their description, which left me puzzled. I can now see that all functions are listed below in the "Listener API" section, and that takeLatest was a bit of a distraction, an api from redux saga that can be emulated via other methods of the listener middleware. Perhaps listing all methods of the listener api before describing each in more detail would help. Or maybe it's fine as it is.
The text was updated successfully, but these errors were encountered:
Per https://www.reddit.com/r/reactjs/comments/tfjz8i/my_opinion_on_reduxtoolkit_rtk/i0wuvkf/ :
The text was updated successfully, but these errors were encountered: