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

updated README for part1/reactivity/updating-arrays-and-objects #651

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

two048
Copy link

@two048 two048 commented Sep 24, 2024

Part 1/Reactivity/Updating arrays and objects has an example

/// no-file
const obj = { foo: { bar: 1 } };
const foo = obj.foo;
foo.bar = 2;

Stating that this "...won't trigger reactivity on obj.foo.bar, unless you follow it up with obj = obj."

Which is true. But either way when an ignorant beginner like me reaches this example, they would struggle with it, as using obj = obj would present them with an error as such /src/lib/App.svelte:13:2 You are assigning to a const. So I changed it to:

/// no-file
let obj = { foo: { bar: 1 } };
let foo = obj.foo;
foo.bar = 2;

If this is I request this PR be merged.

Copy link

vercel bot commented Sep 24, 2024

@two048 is attempting to deploy a commit to the Svelte Team on Vercel.

A member of the Team first needs to authorize it.

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.

1 participant