Skip to content

Commit da3e539

Browse files
matzarRich-Harris
andauthored
docs: Update README.md (sveltejs#520)
* Update README.md docs: 04-updating-arrays-and-objects, add `let obj = { foo: { bar: 'old' } };` for more clarity * Apply suggestions from code review --------- Co-authored-by: Rich Harris <[email protected]>
1 parent 511d1b2 commit da3e539

File tree

1 file changed

+2
-1
lines changed
  • content/tutorial/01-svelte/02-reactivity/04-updating-arrays-and-objects

1 file changed

+2
-1
lines changed

content/tutorial/01-svelte/02-reactivity/04-updating-arrays-and-objects/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,9 @@ A simple rule of thumb: the name of the updated variable must appear on the left
3838

3939
```js
4040
/// no-file
41+
const obj = { foo: { bar: 1 } };
4142
const foo = obj.foo;
42-
foo.bar = 'baz';
43+
foo.bar = 2;
4344
```
4445

4546
...won't trigger reactivity on `obj.foo.bar`, unless you follow it up with `obj = obj`.

0 commit comments

Comments
 (0)