title: Shiny: observe change in global variable
body: <p>I am making a very simple game in Shiny. Basically every player plays in their own session, but they share 1 global variable to keep track of the scores of each player.</p>
  
  <p>I think I'm succeeding having sessions update the global 'scores' variable, but for some (probably dumb) reason I cannot get the global variable to act as a reactive value (i.e. automatically triggering updateActionButton). Minimal code below:</p>
  
  <p>working example:</p>
  
  <pre><code>score &lt;- c(100) 
  
  ui &lt;- fluidPage(
    titlePanel("Hello Shiny!"),
    mainPanel(
      actionButton("increase_score", label = " increase score player 1 "),
      verbatimTextOutput("show_score_p1")
    )
  )
  
  # Server logic
  server &lt;- function(input, output){
    observeEvent(input$increase_score,{
      score[1] &lt;- score[1]+10
    })
    output$show_score_p1 &lt;- renderText({paste(score[1])})  
  }
  
  shinyApp(ui,server)
  </code></pre>
  
  <p>I tried a couple of methods to try and make my global 'score' to be reactive, i.e. makeReactiveBinding(score), but to no avail. Any ideas? Definitely feels like I'm missing something super-obvious</p>