Hacker News new | ask | show | jobs
by JSDave 2773 days ago
"const input$ = sources.DOM.select('.field').events('input')"

Is there a switchMap in here?

What happens if the input element is removed/inserted back into the DOM?

"input('.field', {attrs: {type: 'text'}}),"

It's possible right now for the value in this input to differ from the value in input$.

Maybe use a combineLatest and then this?

"input('.field', {attrs: {type: 'text', value: inputVal}}),"

1 comments

`select().event()` does not use `querySelector` directly under the hood, it filtering and routing all incoming events accordingly. So even if you change the elements, as long as they match the selector, they will be routed correctly. Source: I recently rewrote the DOM driver :)