Reactive-Extensions / rxjs-jquery

Reactive Extensions bindings for jQuery
http://reactive-extensions.github.com/rxjs-jquery
213 stars 40 forks source link

keyupAsObservable() gives error: Uncaught TypeError: Object #<AnonymousObservable> has no method 'publish' #16

Closed JoshRosen closed 10 years ago

JoshRosen commented 10 years ago

I tried to use rxjs-jquery to implement the auto-complete example, but I receive the error

Uncaught TypeError: Object #<AnonymousObservable> has no method 'publish'

when calling keyupAsObservable() on the text input that I selected using JQuery.

Here's a JS Fiddle that reproduces the problem for me in Chrome and Safari (open the web inspector / console to see the error): http://jsfiddle.net/JoshRosen/z93hB/1/

Am I using incompatible versions of rxjs, rxjs-jquery, or jquery, or is this a bug?

mattpodwysocki commented 10 years ago

@JoshRosen Are you using rx.js or rx.lite.js? In order for you to have .publish().refCount() you must make reference to rx.binding.js if you're using rx.js. When you use rx.lite.js this comes out of the box.

JoshRosen commented 10 years ago

I was using only rx.js, so I switched to rx.lite.js and everything works now. Thanks!