sebb8200
sebb8200
SSolidJS
Created by sebb8200 on 4/20/2024 in #support
share context through web-components
Wow that's nice. I don't think you can do that with Lit, can you? I just tried it in the browser in plain HTML, just importing, two separate js-modules. Works like a charm. Wonder if I can make a customElement from a solid-dnd DragDropProvider and drag stuff from one WC to another.
4 replies
SSolidJS
Created by sebb8200 on 12/8/2022 in #support
how to use from or reconcile with an external producer
I understand now, that I have to completely clone everything that comes from the external store. reconcile/from do not seem to diff, but to just check if references change. This seems odd, but is good enough for now.
9 replies
SSolidJS
Created by sebb8200 on 12/8/2022 in #support
how to use from or reconcile with an external producer
I did sth stupid here: I did insert the new elements at the beginning of the list. Now I changed to appending and I get the corrects texts. But the toggle still does not work (only with the clone).
9 replies
SSolidJS
Created by sebb8200 on 12/8/2022 in #support
how to use from or reconcile with an external producer
I ommmited that, because {key: "id"} is the default. With the cloning it also works with explicitly setting the key, and without the cloning it also does not work without setting the key.
9 replies
SSolidJS
Created by sebb8200 on 12/8/2022 in #support
how to use from or reconcile with an external producer
I just tried to clone the update before and now it works:
store.subscribe((update) => {
if (update) {
// this is new! update and update_ look the same in the log.
let update_ = update.map((item) => ({...item}));
setTodos(reconcile(update_));
}
});
store.subscribe((update) => {
if (update) {
// this is new! update and update_ look the same in the log.
let update_ = update.map((item) => ({...item}));
setTodos(reconcile(update_));
}
});
isn't that the point of reconcile that it reconciles using a key (here: default: "id") and not the Object identity....?
9 replies