title: How to break a for loop basing on captured shinyalert input value
body: <p>I am using a <strong>for</strong> <strong>loop</strong> to create multiple popping up messages in my shiny app (using <strong>shinyalert</strong> package).
  I would like messages to stop popping if user had clicked <em>Cancel</em> as an answer to a previous message.
  Below a sample of code illustrating my example</p>
  <pre><code>library(shiny)
  library(shinyalert)
  
  ui &lt;- fluidPage(
      actionButton(&quot;run&quot;, &quot;Run&quot;)
  )
  
  server &lt;- function(input, output, session) {
  
  observeEvent(input$run, {
      
      vector.elements &lt;- c(&quot;A&quot;, &quot;B&quot;, &quot;C&quot;, &quot;D&quot;, &quot;E&quot;)
      decision &lt;&lt;- TRUE
      
      for (element in vector) {
      
      shinyalert(
          title = &quot;Do you accept following element?&quot;,
          text = element,
          showCancelButton =  TRUE,
          callbackR = mycallback)
          
          mycallback &lt;- function(value) {
              decision &lt;&lt;- value
          }
          
          if (decision == FALSE) {
              break
          }
      }
  })
  }
  shinyApp(ui = ui, server = server)
  </code></pre>
  <p>If user clicks on <em>Cancel</em> button as an answer to  <em>Do you accept following element? A</em>, I would like next messages not to pop up.</p>
  <p>Any hint would be much appreciated!</p>