I want to define a list that a user can update by performing certain actions. I have done this:
runApp(list(
ui=fluidPage(
h1('Example')
,textInput('txt','','Text')
,actionButton('add','add')
,verbatimTextOutput('list')
)
,server=function(input,output,session) {
s.list<-reactive(isolate(d.list()))
d.list<-reactive({if (input$add == 0) return()
isolate({
list(input$txt,unlist(s.list()))
})
})
output$list<-renderPrint({
list(unlist(d.list()))
})
}
))
But the list is updated endlessly many times, does anyone know a way to make this work?
source
share