I have a createMemo that depends on a list of objects
const items = createMemo(() => props.articles.map((article) => article.id));
now, when I reorder that list of objects, the createMemo does not fire again, since I guess the content staid the same.
Now I defined
const [reorderTag, setReorderTag] = createSignal(0);
that I increment each time I reorder the list.
Short of
const items = createMemo(() => {
console.log(`reorderTag: ${reorderTag}`);
return props.articles.map((article) => article.id)
});
how do I make sure it refires? Making logic depend on console.log feels dirty.