site: fix grammatical issue in tutorial/update (#6136)

pull/6151/head
Mark A Shuttleworth 4 years ago committed by GitHub
parent 32f58b9d41
commit e84e356ca5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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.
@ -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.

Loading…
Cancel
Save