RXJS 2.0 beta : just add or push data to the observable

Answered RXJS 2.0 beta : just add or push data to the observable

  • viernes, 27 de abril de 2012 9:20
     
     

    Hello,

    I just want to add or push data to the observable. Something like this:

    var query=Rx.Observable.empty();

    query.subscribe(function(s){console.log(s);});

    In my onclick event, I want something like this:

    button.onclick=function(){

    query.Add(inputText.value); // or push

    }

    So each time I change the inputText and click the button, the console is updated and the string added is displayed.

    OK, I know I can use FromEvent to do the same, but I want a way to implement this kind of method.

    Maybe my question is stupid, but I hope it is possible to add data or function dynamically.

    Thanks in advance for your help.

Todas las respuestas