foodcoops / foodsoft-shop

Webshop component for Foodsoft: web-based software to manage a non-profit food coop.
Other
6 stars 2 forks source link

Move to redux-saga #8

Closed wvengen closed 7 years ago

wvengen commented 7 years ago

From https://github.com/foodcoops/foodsoft-shop/issues/2#issuecomment-305625084, use redux-saga to fix debouncing issues. Also makes optimistic updates a bit nicer.

wvengen commented 7 years ago

Optimistic updates are pretty nice, but there is one caveat: when the user updates quantity or tolerance, waits until the network request has just started, and updates the same article again, there is a possible race condition: when optimistic update of the second change happens before the first network request has returned, the latter will override the first. When the second request returns successfully, the correct data is shown again, but it results in flicker (which may cause confusion). For a first version, I think this is acceptable. May need tweaking the debouncing (delay time) a bit.

wvengen commented 7 years ago

Merged in 07738ddcf52a57781c0b6361319d52b29b1b3817.