mirror of
https://github.com/rstudio/shiny.git
synced 2026-01-10 15:38:19 -05:00
Switch from fastmap to rlang for weakref functions
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user