You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I currently have the following logic using this middleware. state = { items: { itemID: itemObj, .... }, viewingItemID: itemID, } Case 1:
'REQUEST' View Item> 'SUCCESS' Add new item to state -> Update viewingItemID to the item ID
OR
Case 2:
'REQUEST' View Item -> Bailout because View Item is already in the state (unable to update viewingItemID)
I then need to change the state's viewingItemID to the ID of the item the user would like to view .
However there is no action emitted to the reducer, so I cannot update the state after the bailout.
At the moment I get around this by dispatching actions 1: fetchItem, 2: setViewingItemID. However, this results in unnecessary state changes/react renders.
Would it be possible to add a bailout action that would be sent to the reducer?
Can I submit a pull request?
The text was updated successfully, but these errors were encountered:
I currently have the following logic using this middleware.
state = { items: { itemID: itemObj, .... }, viewingItemID: itemID, }
Case 1:
'REQUEST' View Item> 'SUCCESS' Add new item to state -> Update viewingItemID to the item ID
OR
Case 2:
'REQUEST' View Item -> Bailout because View Item is already in the state (unable to update viewingItemID)
I then need to change the state's viewingItemID to the ID of the item the user would like to view .
However there is no action emitted to the reducer, so I cannot update the state after the bailout.
At the moment I get around this by dispatching actions 1: fetchItem, 2: setViewingItemID. However, this results in unnecessary state changes/react renders.
Would it be possible to add a bailout action that would be sent to the reducer?
Can I submit a pull request?
The text was updated successfully, but these errors were encountered: