I have a continuous variable (the zoom on a leaflet map) and I want to activate some action (polygon drawing) only when this variable exceeds a given threshold (only at after a given zoom level).

Here is a similar - but simpler and easier to reproduce - toy problem:

```
ui <- bootstrapPage(
  sliderInput("slider", label='a number', min=100, max=400, value = 150),
  plotOutput("plot")
)

server <- function(input, output, session) {
  observeEvent(input$slider > 200, {
    output$plot <- renderPlot(plot(rnorm(10000), rnorm(10000)))
  })
}

shinyApp(ui, server)

```

The problem is that, because of `Shiny`'s reactivity system, the plot (in the toy problem) or the map (in the real problem) keep being updated, even though I would like them to be updated **only when** the threshold is passed, in either direction.

I tried constructions with `observeEvent`, `eventReactive`, `reactiveValues`, etc. mixed with `if ... else` declarations. But is seems like whenever an input is updated, it triggers the whole chain of events, regardless of whether the dependent variables have changed or not. In the toy problem, it does not matter that `input$slider > 200` stays `TRUE` when `input$slider` goes from `100` to `101`, it triggers the plotting anyways.

Please tell me I am wrong!