Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Wheater
    @Wheater
    I submitted an issue for partition with example code. Let me know what you think.
    Wheater
    @Wheater
    @frankpepermans is it possible to return a Future from exahustMap?
    Frank Pepermans
    @frankpepermans
    What do you mean exactly?
    There's toList, which works on any Stream
    Frank Pepermans
    @frankpepermans
    Version 0.24.0 was just released - see https://pub.dev/packages/rxdart#-changelog-tab-
    Wheater
    @Wheater
    nice job!
    Any thoughts on the partition issue?
    Frank Pepermans
    @frankpepermans
    I think it would be nice, if we had destructuring. Currently, stream.where is pretty much the same, no?
    Wheater
    @Wheater
    Not familiar with stream.where honestly. I'll take your word for it.
    Wheater
    @Wheater
    Thinking about stream.where, are you repeating yourself by having the same predicate twice?
    Partition would enable using only a single predicate and returning the two different streams, thus not violating DRY.
    Frank Pepermans
    @frankpepermans
    Not saying we shouldn't have partition, but it would just be much nicer once destructuring lands (eventually).
    Wheater
    @Wheater
    Sure
    Frank Pepermans
    @frankpepermans
    In the meantime, 2 wheres are not that bad
    kimjisung78
    @kimjisung78
    Hello. I have made pagination using by rxdart. Which Subject choose?
    Frank Pepermans
    @frankpepermans
    @kimjisung78 that's a pretty vague question, are you asking what the different Subjects do?
    kimjisung78
    @kimjisung78
    I'm sorry to leave you with such a difficult question. I can’t understand the difference between PublishSubject and BehaviorSubject. And I don’t know “Which one is better if I want to make pagination?”
    Frank Pepermans
    @frankpepermans
    @kimjisung78 they both allow multiple subscribers, but the difference is that when subscribing to a BehaviorSubject, then the last added event will be replayed immediately.
    schmidtfx
    @schmidtfx
    Hello everyone, I'm fairly new to rxdart. I have heard about doOnDone. How would I trigger the done on an subject?
    Frank Pepermans
    @frankpepermans
    @schmidtfx you need to call close()
    Deva Palanisamy
    @devapalanisamy
    Hi, is there guide when to use operator and which operator to use for rxdart? Thanks
    Frank Pepermans
    @frankpepermans
    RxDart has much in common with RxJs, or other Rx implementations, we don't have an equivalent in RxDart
    Deva Palanisamy
    @devapalanisamy
    @frankpepermans thanks for creating powerful library
    Matias Meno
    @enyo
    Hi! Just made the 22_to_23 switch
    so far everything seemed to work fine, but there's one error that I get now:
    .shareValue() doesn't exist anymore
    Ah!
    Since it's an extension I need to import rxdart for it to exist.
    Got it :)
    Great job! Thanks for also providing the codemod
    One suggestion though: add the .seeded() factory constructor to the codemod
    I had to replace all of this manually
    Frank Pepermans
    @frankpepermans
    great :) we're on 0.24.1 meanwhile, but that shouldn't be too big a change
    Rafael Corbellini
    @rafaelcorbellini-egsys
    Hello, I would like to know how do I execute a function when something is emitted (sink / add) in the controller, I know doOnData but it only works if someone is listening to the stream.
    Jack Reilly
    @jackdreilly
    I have a common usage where I want a ValueStream which doesn't shut down when it no longer has listeners. You could imagine that you have a global ValueStream for a Firestore document, and you never want this stream to close due to changes in the number of subscribers, e.g. The workaround I have right now is to register a no-op listener upon creation of the ValueStream, which then "tricks" the stream into thinking it always has a listener. Is there a better pattern I could adopt for this?
    Frank Pepermans
    @frankpepermans
    @rafaelcorbellini-egsys Streams by design only become active after an initial subscription, doOnX would then be a good choice like you mentioned.
    Frank Pepermans
    @frankpepermans
    @jackdreilly since rxdart is built upon the Dart Streams, a ValueStream is like a broadcast Stream, see https://api.flutter.dev/flutter/dart-async/StreamController/StreamController.broadcast.html
    So no, to prevent onCancel, a dummy listener could be a solution in your case
    Jack Reilly
    @jackdreilly
    @frankpepermans thanks for the help and the broadcast documentation, very helpful in understanding the motivation behind the behavior
    lively-bigyan
    @lively-bigyan
    Can I use rxsubject without disposing it?
    Matias Meno
    @enyo
    When I have a ValueStream and I want to map the values, is there a convenient way to map to another ValueStream?
    Right now I'm using this:
    user.map((u) => u != null).shareValueSeeded(user.value != null)
    lizzardman
    @lizzardman
    I just ended up writing custom extension for this
    Matias Meno
    @enyo
    @lizzardman yeah just doing the same
    I'm still being surprised by the behaviour of ValueStream :-/
    Like, you do this:
    newStream = old.map(mapping).shareValue(mapping);
    old.add('foo');
    newStream.value == 'foo'; // That's not the case
    So, unless anyone is listening to the stream, it won't update .value properly
    Matias Meno
    @enyo
    I know it's not really rxdarts fault, but it's still a common pitfall for me.
    Frank Pepermans
    @frankpepermans
    We ideally want to fix this, map is native and returns a MapStream, which isn't a ValueStream. In beta 2 all rx ops do keep the type of the original stream
    Matias Meno
    @enyo
    @frankpepermans oooh, that sounds great. Does that mean, that a map will work even without a listener?