getify / Functional-Light-JS

Pragmatic, balanced FP in JavaScript. @FLJSBook on twitter.
http://FLJSBook.com
Other
16.6k stars 1.96k forks source link

Cannot run ch11-code #137

Closed darkamenosa closed 6 years ago

darkamenosa commented 6 years ago

This is the first time I read this book, so I would like to read and run some example as soon as possible to see how functional programming would help me. However, after pulled the code, I opened ch11-code and and ran it, I always got this error:

Uncaught TypeError: Function.prototype.apply was called on #<HTMLUListElement>, which is a object and not a function
    at a.partiallyApplied [as _next] (fp-helpers.js:48)
    at a.__tryOrUnsub (Rx.min.js:33)
    at a.next (Rx.min.js:31)
    at a._next (Rx.min.js:30)
    at a.next (Rx.min.js:29)
    at a._next (Rx.min.js:95)
    at a.next (Rx.min.js:29)
    at Rx.min.js:70
    at Object.emit (mock-server.js:23)
    at initialStocks (mock-server.js:37)
Rx.min.js:33 Uncaught TypeError: Function.prototype.apply was called on #<HTMLUListElement>, which is a object and not a function
    at a.partiallyApplied [as _next] (fp-helpers.js:48)
    at a.__tryOrUnsub (Rx.min.js:33)
    at a.next (Rx.min.js:31)
    at a._next (Rx.min.js:30)
    at a.next (Rx.min.js:29)
    at a._next (Rx.min.js:95)
    at a.next (Rx.min.js:29)
    at Rx.min.js:70
    at Object.emit (mock-server.js:23)
    at randomStockUpdate (mock-server.js:52)

I'm using Chrome version 62.0 to run this example.

getify commented 6 years ago

Thanks for finding this bug. I introduced it in a recent tweak to the code. Fixed now. :)