plusplusdylan (6) [Avatar] Offline
#1
I can't get listing 4.12 working.
Also, the book listing is different to GitHub.

The error I receive is:
TypeError: Invalid event target


plusplusdylan (6) [Avatar] Offline
#2
OK putting the important bits into a window.onload fixed it

window.onload = function () {
    const searchBox = document.querySelector('#search'); //-> <input>
    const results = document.querySelector('#results'); //-> <ul>

    Rx.Observable.fromEvent(searchBox, 'keyup')
        .debounceTime(1000)
        .pluck('target', 'value')
        .do(query => console.log(`Querying for ${query}...`))
        .map(query => sendRequest(testData, query))
        .subscribe(result => {
            if (result.length === 0) {
                clearResults(results);
            }
            else {
                clearResults(results);
                appendResults(result, results);
            }
        });
};
331872 (124) [Avatar] Offline
#3
That's odd. Glad you were able to make it work. We tested all of the listings and they were all running. We'll look into it.

Thanks!