Hi there,
Perhaps someone has experience with destroying observers in Shiny.
Say for example you have the following function:
# example.R
serverLogic <- function(input, output, session){
observeEvent(input$example, {
print('some server side code here')
})
}
Is it then possible to destroy all observers inside the serverLogic function without having to assign these observeEvents to a variable? I would like to prevent having to assign observeEvents to say a variable x and then having to run x$destroy().
The reason behind asking this is that it would become possible to have a 'hot reload' mechanism for server type functions. If you do not destroy the observers within a function you will unfortunately introduce duplicates which causes unintended effects.
Happy to exchange thoughts,
Michael