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

fix binding to module-level variables #4352

Merged
merged 3 commits into from
Feb 3, 2020
Merged

Conversation

Conduitry
Copy link
Member

Fixes #4086. I looked a bit into the other optimizations I mentioned in that issue, but I don't think they're worth the effort for now, especially since binding to module-level variables is kind of a weird and niche thing to be doing anyway.

<script>
import { onMount } from 'svelte';
let bar;
onMount(() => bar = foo);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there's a nicer way to find out in the test what the value of the module-level foo variable is once the component's mounted, I couldn't find it.

@Conduitry Conduitry merged commit 3cbe38c into sveltejs:master Feb 3, 2020
@Conduitry Conduitry deleted the gh-4086 branch February 3, 2020 17:12
sthagen added a commit to sthagen/sveltejs-svelte that referenced this pull request Feb 3, 2020
fix binding to module-level variables (sveltejs#4352)
kaisermann pushed a commit to kaisermann/svelte that referenced this pull request Feb 6, 2020
jesseskinner pushed a commit to jesseskinner/svelte that referenced this pull request Feb 27, 2020
taylorzane pushed a commit to taylorzane/svelte that referenced this pull request Dec 17, 2020
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 this pull request may close these issues.

Module-level binding in svelte 3.16
1 participant