![]() initialState is an object that contains different initial state values, and the states that the reducers need to act upon. A styled table supporting a construction kit approach and. With the exact same type string, the corresponding reducer will be run. As you can see, the slice above is dedicated to user authentication. Learn more about known vulnerabilities in the slice-and-dice/govuk-react-table package. You need to set the state on the updated array, not on what splice returns. However, splice will change the contents of the array it's called on. If no elements were removed, splice will return an empty array. Also, if any other part of the application happens to dispatch an action splice () returns an array of elements that have been removed from the array. ![]() The keys in the object will be used to generate string action type constants, and these will show up in the ReduxĭevTools Extension when they are dispatched. reducers Īn object containing Redux "case reducer" functions (functions intended to handle a specific action type, equivalent Generated action type constants will use this as a prefix. name Ī string name for this slice of state. This will be used whenever the reducer is called with undefined as its state value, and is primarily useful for cases like reading initial state from localStorage. This may also be a "lazy initializer" function, which should return an initial state value when called. The initial state value for this slice of state.
0 Comments
Leave a Reply. |