-
Notifications
You must be signed in to change notification settings - Fork 1
/
computeObjectUid.r
37 lines (35 loc) · 977 Bytes
/
computeObjectUid.r
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#' @title
#' Compute Object UID (generic)
#'
#' @description
#' Computes the UID of an object based on its name/ID (\code{id}) and the
#' environment where it has been assigned to (\code{where}).
#'
#' @param id \code{\link{character}}.
#' Name of the reactive object.
#' @param where \code{\link{environment}}.
#' Environment to create the object in.
#' @template threedots
#' @return \code{\link{character}}. Object UID (checksum).
#' @example inst/examples/computeObjectUid.r
#' @seealso \code{
#' \link[reactr]{setReactive}
#' }
#' @template author
#' @template references
#' @export
#' @import shiny
#' @import digest
computeObjectUid <- function(
id,
where = parent.frame(),
...
) {
# ls(where)
where <- where
digest::digest(list(id = id, where = capture.output(where)))
# expr <- substitute(digest::digest(list(id = ID, where = WHERE)),
# list(ID = id, WHERE = capture.output(eval(where))))
# print(expr)
# eval(expr)
}