Let’s say you have an infinite scrolling table that renders a bunch of rows. After scrolling down a bit, the user has loaded ~300 rows.
Given that a user can delete rows, and the rows must also be deleted in the DB, if, for example, the user deletes the 170th row:
- Should we remove row 170 immediately on the client and make the DELETE call in the background? (Maybe better user experience?)
- Should we show a loading animation of some sort and only remove once we get a 200 response? (Probably safer / more reliable)
Second part of the question:
- assuming we got a 200 response from the server that the DELETE request was successful, is it now safe to slice the row out of the data that has already been loaded by the client? (Seem faster and more efficient)
- or, should we re-request all ~300 rows? (Seems safer, but very inefficient)
What do you all think? Open to other suggestions/trade off considerations as well. Thanks!
Aucun commentaire:
Enregistrer un commentaire