I have a list Items can be deleted with Swipeout. I don’t really delete these. I update messages every 5 seconds. But the ones I deleted from the list are not added again.
There is such a build:
let mails = [];
// It works when the swipeout delete is triggered.
const onMailDeleted = maild => {
// Do Nothing.
}
const updateMails = () => {
getMails().then(onMails);
}
const onMails = res => {
mails = res.data;
// It does not restore deleted mails, but new messages are added.
$update();
}
const eachMails = () => {
return mails.map(mail => $h`...`);
}
setTimeout(upadateMails, 5000);
return $h`
<ul>
${eachMails()}
</ul>
`;