Shiny: what is the difference between observeEvent and eventReactive?

As @daatali is saying the two functions are used for different purposes. ui <- shinyUI(pageWithSidebar( headerPanel(“eventReactive and observeEvent”), sidebarPanel( actionButton(“evReactiveButton”, “eventReactive”), br(), actionButton(“obsEventButton”, “observeEvent”), br(), actionButton(“evReactiveButton2”, “eventReactive2”) ), mainPanel( verbatimTextOutput(“eText”), verbatimTextOutput(“oText”) ) )) server <- shinyServer(function(input, output) { etext <- eventReactive(input$evReactiveButton, { runif(1) }) observeEvent(input$obsEventButton,{ output$oText <- renderText({ runif(1) }) }) eventReactive(input$evReactiveButton2,{ print(“Will not print”) … Read more

Fire and forget with reactor

1, If your fire-and-forget is already async returning Mono/Flux public Flux<Data> search(SearchRequest request) { return searchService.search(request) .collectList() .doOnNext(data -> doThisAsync(data).subscribe()) // add error logging here or inside doThisAsync .flatMapMany(Flux::fromIterable); } public Mono<Void> doThisAsync(List<Data> data) { //do some async/non-blocking processing here like calling WebClient } 2, If your fire-and-forget does blocking I/O public Flux<Data> search(SearchRequest request) … Read more

Subject vs BehaviorSubject vs ReplaySubject in Angular

It really comes down to behavior and semantics. With a Subject – a subscriber will only get published values that were emitted after the subscription. Ask yourself, is that what you want? Does the subscriber need to know anything about previous values? If not, then you can use this, otherwise choose one of the others. … Read more

What is “callback hell” and how and why does RX solve it?

1) What is a “callback hell” for someone who does not know javascript and node.js ? This other question has some examples of Javascript callback hell: How to avoid long nesting of asynchronous functions in Node.js The problem in Javascript is that the only way to “freeze” a computation and have the “rest of it” … Read more

Hot and Cold observables: are there ‘hot’ and ‘cold’ operators?

I am coming back a few months later to my original question and wanted to share the gained knowledge in the meanwhile. I will use the following code as an explanation support (jsfiddle): var ta_count = document.getElementById(‘ta_count’); var ta_result = document.getElementById(‘ta_result’); var threshold = 3; function emits ( who, who_ ) {return function ( x … Read more