Reactive-Extensions / rx.angular.js

AngularJS Bindings for RxJS
Other
827 stars 89 forks source link

BehaviorSubject with rx.angular #148

Open GuillaumeUnice opened 8 years ago

GuillaumeUnice commented 8 years ago

Hi everyone all is in the title,

I just want to know if with this extension I can have the same behaviour that a BehaviorSubject with this angular module? If, not I would like to know if it's possible to use directly the rxjs library or we have to use this official module?

I have an AngularJS 1.5 with TypeScript and webpack

Thanks for all

ygrene-austin commented 8 years ago

This module uses the Rxjs library and yes BehaviorSubject will behave (lol) how it should.

GuillaumeUnice commented 8 years ago

Indeed, that works but I believed that no works because I don't have any type autocompletion with my TypeScript I don't have any d.ts that works?

I close and open a new issue for this? Or today there is a d.ts available?

Thanks for all

ygrene-austin commented 8 years ago

https://github.com/Reactive-Extensions/rx.angular.js/tree/master/ts On Wed, Aug 10, 2016 at 11:57 PM GuillaumeUnice notifications@github.com wrote:

Indeed, that works but I believed that no works because I don't have any type autocompletion with my TypeScript I don't have any d.ts that works?

I close and open a new issue for this? Or today there is a d.ts available?

Thanks for all

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Reactive-Extensions/rx.angular.js/issues/148#issuecomment-239086613, or mute the thread https://github.com/notifications/unsubscribe-auth/ATeuMDXn6fWAZb6_OGcJ-5hiYUlfcUltks5qesfpgaJpZM4JUi1v .

Austin Adams Sr. Web Application Developer www.ygreneworks.com 815 5th Street | Santa Rosa, CA 95404

GuillaumeUnice commented 8 years ago

Ok i shared my code to show there is no autocompletion when I create a Subject.

export class LoginService {

  public source = new this.rx.Subject();

  /** @ngInject */
  constructor(
    private rx: rx.angular.IRxScope)
  { 

  }

}

Here Subject is underline and this is logic because IScope interface no have Subject function. I think I don't use rx.angular in a correct way, but here the Subject is correctly create :s

So how can I create Subject with this d.ts definition correctly?

Thanks, Best regards

stephengardner commented 7 years ago

Did this question actually get resolved? Should there not be a ´rx.BehaviorSubject´?

Right now I'm using the imported version from the actual rxjs library because I don't know how to properly create a Behavior Subject using this one.

I believe that was the original question.

Is there an answer?

stephengardner commented 7 years ago

Hey @ygrene-austin do you have an example of how to create a BehaviorSubject with this module?