![]() ![]() ![]() Importing: import * as coupons from './couponsActions' and any other actions I need seem inappropriate. Would a middleware be appropriate here, in which I sniff for a certain "action.type" and if I see it, I can dispatch other action.type's or is there a way to call action creators from within the productsReducer? So, I want to be able to call "other reducers" or their action creators from within the productsReducer. Long winded I know, I just wanted to explain my situation. ![]() but the rub is I have a progress modal, and prior to getting to the coupons page, a user can open the progress modal. I can do this via going thru the flow to the coupon page, because on that page I just reconcile the data on componentWillMount. Introduction In Part 4: Using Redux Data, we saw how to use multiple pieces of data from the Redux store inside of React components, customize the contents of action objects before they're dispatched, and handle more complex update logic in our reducers. but the user can "edit" at any time, so if they then edit "sneakers" and say, choose another producer, I have to be able to alter the couponsReducer in real time, because a progress modal needs to reflect this. As such, as a user moves thru the app process, they get couponsReducer associated with it. Think of it as if a user selects "sneakers", and this state management is in a reducer called productsReducer. There is a time in which one of my reducers updates the state (because of an edit), and as such, I have to then make sure the other reducers see this update and adjust their state accordingly. So, I have an app that has multiple reducers, and thus multiple action creators associated. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |