-
Bug Report When building frontend storage with Redux Toolkit, one way to prevent state loss is to use the library 'reselect'. When using TypeScript, I noticed a lot of missing features for this ecosystem. Please provide an example of Redux Toolkit with extra reducers for API calls that uses TypeScript, along with selectors for state objects using TypeScript. There are a lot of variations posted on GitHub that are not functional when tested. Preferred frontend is React. 🔎 Search Terms TypeScript 🕗 Version & Regression Information Please keep and fill in the line that best applies: This is the behavior in every version I tried, and I reviewed the FAQ for entries about Redux Toolkit. No Playground. 💻 Code No code- requesting a code example from scratch. 🙁 Actual behavior Tried to use TypeScript in Redux Toolkit along with the library Reselect. Errors prevented the selectors and extra reducers. 🙂 Expected behavior Building in JavaScript delivers built-in error handling and loading status for API calls and selectors for each state object that do not lose state from asynchronous activities. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
@secretLabHQ389 : I'm not sure what you're asking for, tbh. What are you actually trying to accomplish? What does your own app code look like? What specific problems are you having? What features are "missing"? |
Beta Was this translation helpful? Give feedback.
-
Hello markerikson, I appreciate your time and interest. I am passionate about Redux and its integrations with React. I created this skeletal React/Redux application example to run in your localhost in my spare time: https://github.com/secretLabHQ389/react18-travel-app/blob/main/src/store/propertySlice.js
QUESTIONS:
|
Beta Was this translation helpful? Give feedback.
The below example is fully typed. All the type information here is part of
updateUser
, so all the resulting types ofpayload
etc. can automatically be derived from that. You don't need to write manual type annotations for TypeScript to work correctly here.