Closed paoloricciuti closed 1 month ago
Latest commit: 6382da6e6c5bccd644b8450ca0466c17fa826cca
The changes in this PR will be included in the next version bump.
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
Name | Status | Preview | Last Commit |
---|---|---|---|
runed | ✅ Ready (View Log) | Visit Preview | 6382da6e6c5bccd644b8450ca0466c17fa826cca |
This fixes a bug someone opened in the svelte repo but it was actually our (namely my lol) bad.
EDIT: oh they also reported here... Closes #121
https://github.com/sveltejs/svelte/issues/12571#issuecomment-2248328612
We should avoid writing to state in the getter but we can just leave the state undefined and return the actual value from mediaQuery list (it will still be reactive from the moment we register the listener since we are still accessing the signal to check if it's undefined).
EDIT: i've also changed effectRegistered to a number to handle the case where multiple components that access the same instance of the class mount in the same tick.