add mailboxes

This commit is contained in:
marlon-erler
2024-07-08 21:13:56 +02:00
parent 85164a4e0a
commit b88959e135
16 changed files with 342 additions and 79 deletions
+3 -6
View File
@@ -205,19 +205,16 @@ export function createElement(
try {
const [listState, toElement] = value as [
listState: ListState<any>,
(
item: any,
listState: ListState<any>
) => HTMLElement
ListItemConverter<any>
];
listState.handleAddition((newItem) => {
const child = toElement(newItem, listState);
const child = toElement(newItem);
listState.handleRemoval(newItem, () =>
child.remove()
);
element.append(child);
child.scrollIntoView();
element.scrollTop = element.scrollHeight;
});
} catch {
throw `error: cannot process subscribe:children directive because ListItemConverter is not defined. Usage: "subscribe:children={[list, converter]}"; you can find a more detailed example in the documentation`;