Skip to content

Commit

Permalink
teal_data instead of new_teal_data
Browse files Browse the repository at this point in the history
  • Loading branch information
gogonzo committed Oct 23, 2023
1 parent 2f11384 commit ec575f9
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions R/module_teal_with_splash.R
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,13 @@ srv_teal_with_splash <- function(id, data, modules, filter = teal_slices()) {
raw_data <- if (inherits(data, "teal_data")) {
reactiveVal(data)
} else if (teal.data::is_pulled(data)) {
new_data <- new_teal_data(
data = lapply(data$get_datasets(), function(x) x$get_raw_data()),
code = data$get_code(),
keys = data$get_join_keys()
new_data <- do.call(
teal.data::teal_data,
c(
lapply(data$get_datasets(), function(x) x$get_raw_data()),
code = data$get_code(),
join_keys = data$get_join_keys()
)
)
reactiveVal(new_data) # will trigger by setting it
} else {
Expand All @@ -83,10 +86,13 @@ srv_teal_with_splash <- function(id, data, modules, filter = teal_slices()) {
if (!is.null(data)) {
# raw_data is a reactive which returns data only when submit button clicked
# otherwise it returns NULL
new_teal_data(
data = lapply(data$get_datasets(), function(x) x$get_raw_data()),
code = data$get_code(),
keys = data$get_join_keys()
do.call(
teal.data::teal_data,
c(
lapply(data$get_datasets(), function(x) x$get_raw_data()),
code = data$get_code(),
join_keys = data$get_join_keys()
)
)
}
})
Expand Down

0 comments on commit ec575f9

Please sign in to comment.