Redux Toolkit also has a new RTK Query data fetching API. The createSelector utility from the Reselect library, re-exported for ease of use.createEntityAdapter: generates a set of reusable reducers and selectors to manage normalized data in the store.createAsyncThunk: accepts an action type string and a function that returns a promise, and generates a thunk that dispatches pending/fulfilled/rejected action types based on that promise.createSlice(): accepts an object of reducer functions, a slice name, and an initial state value, and automatically generates a slice reducer with corresponding action creators and action types.The function itself has toString() defined, so that it can be used in place of the type constant. createAction(): generates an action creator function for the given action type string. In addition, it automatically uses the immer library to let you write simpler immutable updates with normal mutative code, like = true.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |