Skip to content

Commit

Permalink
Make sentence less awkward
Browse files Browse the repository at this point in the history
  • Loading branch information
jennybc committed Sep 12, 2020
1 parent 1048773 commit e42e5af
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Code.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ If you expect it to be `TRUE` (the default), and the user has set it to be `FALS

### Manage state with withr

The withr package is inspired by `base::on.exit()` (which is covered in the next section) and provides a more flexible `on.exit()`-like toolkit.
The withr package is inspired by `base::on.exit()` and provides a flexible `on.exit()`-like toolkit (`on.exit()` itself is covered in the next section).
`withr::defer()` can be used as a drop-in replacement for `on.exit()`, but the real reason to use it is to get its default "stack-like" behaviour and to use its `envir` argument (in more advanced usage).

The general pattern is to capture the original state, schedule its eventual restoration "on exit", then make the state change.
Expand Down

0 comments on commit e42e5af

Please sign in to comment.