How does rxjs set click to get the value of another input?

for example, one listens for input input and the other gets the value of input when the button is clicked

Mar.13,2021

let button = document.querySelector('button');
let input = document.querySelectorAll('input')[0];
let input$ = Rx.Observable.fromEvent(input, 'keyup')
    .pluck('target', 'value');
let button$ = Rx.Observable.fromEvent(button, 'click');
button$.withLatestFrom(input$, (_, data) => data)
        .subscribe((data) => console.log(data))
Menu