Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Brian Egan
    @brianegan
    (The crew accidentally triggered all of the fireworks for a 10-15 minute show right at the beginning)
    One small update: I realized one thing I forgot to fix was all of the API doc links in the readme. Gonna push up 0.23.1 patching those up
    Frank Pepermans
    @frankpepermans
    Hehe that's some impressive fireworks! If you can enjoy it from up in the ISS, it must be good :)
    stanislasdrg
    @stanislasdrg
    Hi guys, is the only way to initialise a ReplaySubject calling .add() at runtime ?
    .startWith() throws a type error in my case.

    ReplaySubject is in a Shared Service as such :
    ReplaySubject<bool> userProvidesLiquidity = ReplaySubject<bool>(maxSize: 1);

    And is called within one of my app's template :
    <div *ngIf="(sharedService.userProvidesLiquidity | async)">

    I am trying to init with a false value.
    If I call .add(false) in OnInit it works, I am just curious whether this is the best way to do it
    Frank Pepermans
    @frankpepermans
    startWith would be your best option
    Stream<bool> _userProvidesLiquidityWithStart;
      Stream<bool> get userProvidesLiquidityWithStart =>
          _userProvidesLiquidityWithStart ??=
              userProvidesLiquidity.startWith(false);
    stanislasdrg
    @stanislasdrg
    Unfortunately the same code throws TypeError: Instance of 'minified:iV<bool>': type 'minified:iV<bool>' is not a subtype of type 'minified:oD<bool>' if I initialise my ReplaySubject the following way :
    ReplaySubject<bool> userProvidesLiquidity = ReplaySubject<bool>(maxSize: 1).startWith(false);
    Ah ok I see
    It is a lot more verbose though.
    Thanks @frankpepermans
    Frank Pepermans
    @frankpepermans
    The getter is just a workaround so that Angular doesn't go into an update loop. On each update cycle, it will invoke your subject.startWith(), this will yield a new Stream instance on every call, causing overflow. If you store the Stream as a refernce, as with that getter, you can overcome that issue.
    Frank Pepermans
    @frankpepermans
    PS a ReplaySubject with maxSize: 1 is really a BehaviorSubject (which effectively only replays the last value on subscribe)
    stanislasdrg
    @stanislasdrg

    @frankpepermans

    The getter is just a workaround so that Angular doesn't go into an update loop. On each update cycle, it will invoke your subject.startWith(), this will yield a new Stream instance on every call, causing overflow. If you store the Stream as a reference, as with that getter, you can overcome that issue.

    Is it the startWith() that is responsible for such a behaviour ? I kind of expected the same instance to be returned each time as you have noticed.
    Frank Pepermans
    @frankpepermans
    No, it will yield a new Stream. The original Stream cannot be altered, as it might be consumed by other Subscribers. So startWith does return a new, transformed Stream.
    Think List.map, which returns an Iterable, leaving the original List untouched
    stanislasdrg
    @stanislasdrg
    @frankpepermans Thank you very much for the straightforward explanation, appreciate it.
    Byron Ferguson
    @byronferguson
    Evening all
    Dusting off a Flutter project and updating pubs
    _login
            .map<Request>(_formRequest)
            .doOnData((_) {
              _attemptLogin.sink.add(true);
            })
            .asyncMap(Auth.login)
            .doOnData((_) {
              _attemptLogin.sink.add(false);
            })
            .listen(_userAuth.sink.add);
    I can’t seem to get the latest version to execute the asyncMap()
    Frank Pepermans
    @frankpepermans
    Did the first doOnData trigger? Is Auth.login triggered?
    Frank Pepermans
    @frankpepermans
    Wheater
    @Wheater
    Not much going on in here. I'm a huge fan of RxJS and am moving over to dart to learn Flutter. I'd like to contribute in some way, is the doc a good place to start?
    Frank Pepermans
    @frankpepermans
    We can always use help :) rxdart is pretty stable currently, this channel is pretty quiet, so I assume most folks are just happy using it
    Wheater
    @Wheater
    Glad to pitch in when needed.
    Frank Pepermans
    @frankpepermans
    We're gearing up for a 1.0 release, there's a few issues on git regarding docs, or other ones
    Wheater
    @Wheater
    Awesome, I'll take a look tomorrow or Sunday hopefully.
    Frank Pepermans
    @frankpepermans
    See the current dev release, which is almost 1 to 1 with the master branch
    Wheater
    @Wheater
    What's the process to follow for PRs, fork then PR?
    Frank Pepermans
    @frankpepermans
    Yeah that's fine
    Usually @brianegan and myself review before merging, nothing special
    I guess our biggest focus is correctly informing newcomers about the differences between dart streams and observables. That remains a point of confusion for many
    Wheater
    @Wheater
    Sounds good. I am a professional dev, but new to open source, so it will take some getting used to.
    Frank Pepermans
    @frankpepermans
    No worries, we're here if you need help :)
    Wheater
    @Wheater
    Awesome! Thanks for the intro. I'll start out with docs to get familiar then move on wherever else needed :)
    Wheater
    @Wheater
    @frankpepermans which branch is the dev branch I should fork from?
    Wheater
    @Wheater
    Submitted a couple of PRs from the getting started issue set. One is a simple link change, the other is the interval operator.
    Frank Pepermans
    @frankpepermans
    Thanks! Master is the main branch
    Wheater
    @Wheater
    @frankpepermans build is passing now for the interval PR
    Wheater
    @Wheater
    @frankpepermans given my failure on the previous PR I submitted, where is a good place to get started with the next?
    Frank Pepermans
    @frankpepermans
    Not sure, we mostly act on incoming issues atm, is there anything from rxjs that you currently miss?
    Wheater
    @Wheater
    Nothing that I can tell of so far. Y'all have done a great job.
    Wheater
    @Wheater
    I will find another issue that looks interesting and work on it. I was curious about the combineLatest operator that was mentioned in: ReactiveX/rxdart#388
    If you think there is value in taking a look at that, I will work on it. It does seem nice to be able to chain combineLatest instead of using the static operators.
    Frank Pepermans
    @frankpepermans
    @Wheater sounds good, but keep in mind that the proposed extension in that issue is not good enough.
    Wheater
    @Wheater
    I will look more in-depth later. What are the known issues with it at the moment?