Comments (2)
Not currently. It's definitely on the TODO list. There are basically two (possibly overlapping) approaches that are possible:
- Use some syntax to declare the key, like
{{#each:id ...}}
or{{#eachkeyed foo, i, key}}
or whatever. - Create an API for manipulating lists programmatically
The advantage of 1 is that it's an easy way to get that functionality even in deeply nested each blocks. The advantage of 2 is that you can be very precise about which parts of the component need to be checked for changes (i.e. you can insert an item into a list and not touch anything else at all, whereas with keyed updates you need to account for changes in items whose keys are the same), and there's no requirement for any sort of diffing.
Open to API/design suggestions!
from svelte.
Closing in favour of #81
from svelte.
Related Issues (20)
- add typings for svelte/events on(document, on(window
- Track binding values HOT 2
- Can we have specific types for reactive state in Svelte 5? HOT 1
- Svelte 5: Action parameters type inferred as 'any' despite explicit typing
- `class:`/`style:` directives can be overridden by `class`/`style` attributes HOT 4
- Declarative Shadow DOM doesn't work HOT 5
- migrate: Merging event handlers adds an unnecessary parameter HOT 18
- migrate: incorrect parenthesis handling in derived expressions
- Svelte 5: `<script module>` - Cannot use JSX unless the '--jsx' flag is provided. js(17004) HOT 1
- Reactivity breaks on derived if condition (Svelte 5)
- Svelte 5: Logging a proxy in an `$effect` causes it to fire on any mutation HOT 1
- Bug about the same page navigation.
- Uncaught ReferenceError: $$props is not defined HOT 5
- Destructuring reactive components cause $state not being reactive HOT 3
- Svelte 5: `$effect` somewhat broken between v247 and v248 HOT 10
- Compiler option for bundler to provide optimization info about asset import
- Outro transition gets interrupted when mutating array
- Update of $state variable overwrites it instead of update HOT 20
- `$derived(...)` argument expression is never executed HOT 28
- Svelte 5: compilation error when referencing shadowed state
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from svelte.