Switch from fastmap to rlang for weakref functions

This commit is contained in:
Winston Chang
2019-06-13 14:52:14 -05:00
parent 9e133e0ecc
commit 26ad773f77
2 changed files with 4 additions and 4 deletions

View File

@@ -90,7 +90,7 @@ Suggests:
reactlog (>= 1.0.0),
magrittr
Remotes:
r-lib/fastmap@weakref
wch/rlang@weakref
URL: http://shiny.rstudio.com
BugReports: https://github.com/rstudio/shiny/issues
Collate:

View File

@@ -25,7 +25,7 @@ Dependents <- R6Class(
}
if (ctx$isWeak()) {
.dependents$set(ctx$id, fastmap::make_weakref(ctx))
.dependents$set(ctx$id, rlang::new_weakref(ctx))
} else {
.dependents$set(ctx$id, ctx)
}
@@ -50,8 +50,8 @@ Dependents <- R6Class(
lapply(
.dependents$values(sort = TRUE),
function(ctx) {
if (fastmap::is_weakref(ctx)) {
ctx <- fastmap::get_weakref(ctx)
if (rlang::is_weakref(ctx)) {
ctx <- rlang::wref_key(ctx)
if (is.null(ctx)) {
# Can get here if weakref target was GC'd
return()