Skip to content

Commit da37f0d

Browse files
Add 'void' progression handler [#72]
1 parent f5cb1e0 commit da37f0d

File tree

4 files changed

+61
-0
lines changed

4 files changed

+61
-0
lines changed

NAMESPACE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export(handler_progress)
1414
export(handler_shiny)
1515
export(handler_tkprogressbar)
1616
export(handler_txtprogressbar)
17+
export(handler_void)
1718
export(handler_winprogressbar)
1819
export(handlers)
1920
export(make_progression_handler)

NEWS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ Package: progressr
33

44
Version: 0.4.0-9000 [2020-04-06]
55

6+
NEW FEATURES:
7+
8+
* Add 'void' progression handler.
9+
610
BUG FIXES:
711

812
* Only the last of multiple progression handlers registered was used.

R/handler_void.R

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#' Progression Handler: No Progress Report
2+
#'
3+
#' @inheritParams make_progression_handler
4+
#'
5+
#' @param \ldots Additional arguments passed to [make_progression_handler()].
6+
#'
7+
#' @examples
8+
#' \donttest{\dontrun{
9+
#' handlers(handler_void())
10+
#' with_progress(y <- slow_sum(1:100))
11+
#' print(y)
12+
#' }}
13+
#'
14+
#' @details
15+
#' This progression handler give not output - it is invisible and silent.
16+
#'
17+
#' @export
18+
handler_void <- function(intrusiveness = 0, ...) {
19+
reporter <- local({
20+
list(
21+
initiate = function(config, state, progression, ...) NULL,
22+
update = function(config, state, progression, ...) NULL,
23+
finish = function(config, state, progression, ...) NULL
24+
)
25+
})
26+
27+
make_progression_handler("void", reporter, intrusiveness = intrusiveness, ...)
28+
}

man/handler_void.Rd

Lines changed: 28 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)