mirror of
https://github.com/rstudio/shiny.git
synced 2026-02-07 05:04:58 -05:00
Better reactivePoll example. Closes #1678
This commit is contained in:
@@ -57,9 +57,22 @@ will be executed in a reactive context; therefore, they may read reactive
|
||||
values and reactive expressions.
|
||||
}
|
||||
\examples{
|
||||
# Assume the existence of readTimestamp and readValue functions
|
||||
function(input, output, session) {
|
||||
data <- reactivePoll(1000, session, readTimestamp, readValue)
|
||||
|
||||
data <- reactivePoll(1000, session,
|
||||
# This function returns the time that log_file was last modified
|
||||
checkFunc = function() {
|
||||
if (file.exists(log_file))
|
||||
file.info(log_file)$mtime[1]
|
||||
else
|
||||
""
|
||||
},
|
||||
# This function returns the content of log_file
|
||||
valueFunc = function() {
|
||||
read.csv(log_file)
|
||||
}
|
||||
)
|
||||
|
||||
output$dataTable <- renderTable({
|
||||
data()
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user