Content-Length: 247948 | pFad | http://github.com/sveltejs/svelte/issues/16036

AF fromStore() wrapper not updating deep reactivity - both ways · Issue #16036 · sveltejs/svelte · GitHub
Skip to content

fromStore() wrapper not updating deep reactivity - both ways #16036

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
dualjack opened this issue May 29, 2025 · 3 comments
Closed

fromStore() wrapper not updating deep reactivity - both ways #16036

dualjack opened this issue May 29, 2025 · 3 comments

Comments

@dualjack
Copy link

Describe the bug

When using fromStore()

<script lang=ts>
	import {writable, fromStore} from "svelte/store";
	
	const x = writable({name: 'test'});
	const y = fromStore(x);
</script>

updating deep value of y.current.name - is not triggering update of x.name.
See below for playground link.


Additional info:
Using primitive value for store, ex.

conxt x = writable('TEXT')
const y = fromStore(x);

y.current = 'blabla';

works fine.

Reproduction

https://svelte.dev/playground/9c230404f43548bd9098c598ff205285?version=5.33.8

Logs

System Info

Svelte 5.33.X

Severity

blocking an upgrade

@Ocean-OS
Copy link
Contributor

Ocean-OS commented May 29, 2025

fromStore doesn't proxy the store, so you don't get deep reactivity.

@dualjack
Copy link
Author

fromStore doesn't proxy the store, so you don't get deep reactivity.

Thank you for your response!

Could you kindly show me where is it documented?
I must have missed something in docs.

What is the point of having fromStore() if it literally converts one format to other - just in time. Seems redundant and misleading in context of stores and reactivity.

@dummdidumm
Copy link
Member

It is not documented because why would we document the non-existence of something (exceptions apply ofc)?

These helpers are meant as helping convert one to the other while the source is the, well, source of truth, so you should update only the source and not the derivation.

Therefore closing, but feel free to clarify what in the documentation would have helped you to not get confused, maybe we can add something

@dummdidumm dummdidumm closed this as not planned Won't fix, can't repro, duplicate, stale May 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/sveltejs/svelte/issues/16036

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy