Reactive-Extensions / RxJS-DOM

HTML DOM Bindings for the Reactive Extensions for JavaScript
http://reactivex.io
Other
437 stars 99 forks source link

Using RxJS-DOM with TypeScript (Angular 2) #123

Closed kemalcany closed 8 years ago

kemalcany commented 8 years ago

Hello guys,

Are there any resources online to demonstrate how we can use Rx.dom in TypeScript (and Angular 2) ?

Adding rx-dom typings such as @types/rx-dom solves the issue of accessing Rx.Dom from TypeScript files.

/// <reference path="../manual_typings/rx-dom.d.ts" /> ... var throttledInput = Rx.DOM.keyup(page);

But then, the definition file cannot access the Rx modules (such as Rx.Observer) and gives error during compile.

src\manual_typings\rx-dom.d.ts(11,31): error TS2305: Module 'Rx' has no exported member 'Observer'. src\manual_typings\rx-dom.d.ts(59,102): error TS2305: Module 'Rx' has no exported member 'Observable'. src\manual_typings\rx-dom.d.ts(61,25): error TS2305: Module 'Rx' has no exported member 'Observable'. src\manual_typings\rx-dom.d.ts(64,81): error TS2305: Module 'Rx' has no exported member 'Observable'. ...

I've spent a lot of time finding resources on how to setup Rx.Dom correctly on a TypeScript environment but couldn't find anything concrete. This thread will surely help others too so please, if anyone have any ideas, please share...

Cheers!

skofgar commented 7 years ago

Are there any updates on how Rx-dom can be used with Angular 4?

paulpdaniels commented 7 years ago

Strictly speaking they aren't compatible, because the RxJS version used in angular is v5, this library only supports v4.

skofgar commented 7 years ago

Hello @paulpdaniels Okay thanks! I was interested in using the websocket wrapper and maybe some more features down the road. But I think I will explore some alternatives. Are there any plans to support v5 in the future? Thank you!