Get a reactive that polls for new payload data
Value
A reactive expression (class "reactive") that returns a list with two
elements when new data is available: payload
(the parsed request body)
and meta
(metadata including timestamp, remote address, headers, etc.),
or NULL
if no data has been received yet.
Examples
if (interactive()) {
server <- function(input, output, session) {
latest_data <- payload_last("/data", session)
observeEvent(latest_data(), {
data <- latest_data()
if (!is.null(data)) {
print(data$payload)
print(data$meta$timestamp)
}
})
}
}