Skip to content
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

Autosubscribe to nested stores without intermediate assignment #7645

Closed
johnnysprinkles opened this issue Jul 1, 2022 · 1 comment
Closed

Comments

@johnnysprinkles
Copy link

Describe the problem

I sometimes have nested stores, i.e. a store that has properties which are themselves stores. To get at the value, I assign to an intermediate variable like so:

let barStore = $foo.barStore;
if (someExpression > $barStore) {
   ...
}

But it would be pretty natural to allow this inline, as in:

if (someExpression > $($foo.barStore)) {
  ...
}

I imagine this has been proposed but couldn't find the issue number.

Describe the proposed solution

An update to the syntax and compiler to allow the above.

Alternatives considered

The status quo.

Importance

nice to have

@Conduitry
Copy link
Member

Duplicate of #4079.

#6373 might be another possible way towards this, but that would probably be a Svelte 4 thing.

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

2 participants