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

Auto-declare variables in reactive declarations, in certain cases #2059

Closed
Rich-Harris opened this issue Feb 6, 2019 · 0 comments · Fixed by #2062
Closed

Auto-declare variables in reactive declarations, in certain cases #2059

Rich-Harris opened this issue Feb 6, 2019 · 0 comments · Fixed by #2062
Milestone

Comments

@Rich-Harris
Copy link
Member

At present you have to declare all variables that are assigned to in reactive declarations:

let b;
$: b = a + 1;

It would be much nicer to just do this:

$: b = a + 1;

In other words if the body is an ExpressionStatement whose expression is an AssignmentExpression whose left hand side is an Identifier, inject the let b.

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

Successfully merging a pull request may close this issue.

1 participant