lukeraymonddowning / infinite_scrolling_in_inertia_js

3 stars 6 forks source link

Allow items to be deleted, while preserving the state of all items on the page, the current scroll position, etc #6

Open connecteev opened 1 year ago

connecteev commented 1 year ago

Allow items to be deleted, while preserving the state of all items on the page, the current scroll position, etc. Ex: An item is deleted by the currently logged-in user

According to @lukeraymonddowning 's comment here: things are likely going to get more complicated when you introduce destructive actions, but I think the simplest way would be to delete via an async request outside of the inertia lifecycle (ie: a standard ajax request). Then, you could manually remove the deleted item from the items ref array in JS.