Skip to content

Assorted docs tweaks suggestions #2130

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
markerikson opened this issue Mar 16, 2022 · 2 comments · Fixed by #3738
Closed

Assorted docs tweaks suggestions #2130

markerikson opened this issue Mar 16, 2022 · 2 comments · Fixed by #3738
Labels

Comments

@markerikson
Copy link
Collaborator

Per https://www.reddit.com/r/reactjs/comments/tfjz8i/my_opinion_on_reduxtoolkit_rtk/i0wuvkf/ :

While my memories from reading the docs are still fresh, here are two things I was struggling with yesterday:

  1. 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.
  2. 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.
@markerikson
Copy link
Collaborator Author

Did the listenerApi types in #2138 .

@shreya024
Copy link

@markerikson Interested to add an example of calling API with headers and API keys using RTK Query

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants