rstudio / promises

A promise library for R
https://rstudio.github.io/promises
Other
197 stars 19 forks source link

Chained functions should keep track of visibility #58

Closed wch closed 3 years ago

wch commented 3 years ago

then functions currently don't pass along the visible attribute.

promise_resolve(invisible(1))$
  then(function(value) {
    print(withVisible(value))
  })
#> $value
#> [1] 1
#> 
#> $visible
#> [1] TRUE

But functions in R can do it:

f <- function(value) {
  print(withVisible(value))
}
f(invisible(1))
#> $value
#> [1] 1
#> 
#> $visible
#> [1] FALSE

So promises should do it as well.