Skip to content

Commit

Permalink
site: fix grammatical issue in tutorial/update (sveltejs#6136)
Browse files Browse the repository at this point in the history
  • Loading branch information
MShuttle authored Mar 30, 2021
1 parent 32f58b9 commit e84e356
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions site/content/tutorial/07-lifecycle/03-update/text.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: beforeUpdate and afterUpdate
---

The `beforeUpdate` function schedules work to happen immediately before the DOM has been updated. `afterUpdate` is its counterpart, used for running code once the DOM is in sync with your data.
The `beforeUpdate` function schedules work to happen immediately before the DOM is updated. `afterUpdate` is its counterpart, used for running code once the DOM is in sync with your data.

Together, they're useful for doing things imperatively that are difficult to achieve in a purely state-driven way, like updating the scroll position of an element.

Expand All @@ -21,4 +21,4 @@ afterUpdate(() => {
});
```

Note that `beforeUpdate` will first run before the component has mounted, so we need to check for the existence of `div` before reading its properties.
Note that `beforeUpdate` will first run before the component has mounted, so we need to check for the existence of `div` before reading its properties.

0 comments on commit e84e356

Please sign in to comment.