Closed egilsster closed 3 months ago
filteredItems
must be in closure as well:
return {
get filteredItems() { return filteredItems; },
};
Bingo, that plus I had to move the filter inside the scope of the derived callback. Thank you!
I wonder if there's something the compiler can warn about in these situations.
Describe the bug
I am migrating a medium-sized app that uses stores quite heavily to Svelte 5. I've got a few stores that rely on a search filter and I expect to get a fresh list of items based on the value in the filter store. This appears to work fine when its all done within the component, however, once the logic is extracted into a store, the
derived.by
that uses the items + filter does not re-run when the filter value changes.Reproduction
I've put up a reproduction here: https://github.com/egilsster/runes-repro – notes with steps to reproduce are in the README.
Logs
No response
System Info
Severity
blocking an upgrade