-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Docs - add 'Migrating to RTK Query' page #1060
Docs - add 'Migrating to RTK Query' page #1060
Conversation
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 09a6531:
|
Deploy Preview for redux-starter-kit-docs ready! Built with commit 09a6531 https://deploy-preview-1060--redux-starter-kit-docs.netlify.app |
A couple suggestions: First, let's retitle it "Migrating to RTK Query". I don't think we need to specifically show examples of switching from sagas and observables also, but let's keep the title more general. Next, I'd suggest starting with a brief recap like:
|
Thanks @markerikson, I've made those changes |
- add data-fetching recap
4ca0f96
to
6429f1e
Compare
Content-wise, this doesn't really feel like a "migrating" page at the moment. The examples section is more like "here's two separate examples, one without RTKQ and one with RTKQ". I'd like to see more of a "here's our starting point with just RTK, and here's the individual steps I'd take to convert the RTK code to RTKQ", similar to what I have in https://redux.js.org/tutorials/fundamentals/part-8-modern-redux for going from handwritten Redux logic to RTK. |
@markerikson I've re-written it with a more 'step-based' approach. Let me know your thoughts |
Actually I've just realised this snippet is wrong (regarding the 'status' check) const response = await fetch(
`https://pokeapi.co/api/v2/pokemon/${name}`
).then((res) => res.json())
if (response.status < 200 || response.status >= 300) {
return rejectWithValue(response)
} I'll fix that up later on |
Looks fairly good. We could probably make more improvements, but at this point I just want to get some reasonable content in place for any remaining topics so we can launch. |
Related to #964
'Migrating from thunks''Migrating to RTK Query' pageNote that realistically it is more like 'How to delete your thunk code and re-write it shorter with RTK Query'