Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Denis Beketsky
    @TatsuUkraine
    I created an issue on github with the simple test case for such scenario ReactiveX/rxdart#641
    just trying to understand if it's really an issue
    Denis Beketsky
    @TatsuUkraine
    btw, cool solution with materializer
    Frank Pepermans
    @frankpepermans
    It was indeed intentionally designed to see the latest values regardless of errors, since the errors pass down via onError handlers. So then maybe 2 new optional parameters are needed, still the cancelOnError one, since it cannot be resolved always from the source streams, plus the a new one to prevent emission when one is in an error state, e.g. ignoreErrorStates which is then true by default for backwards compatibility.
    Denis Beketsky
    @TatsuUkraine
    👍ok, thank you for your help, I will add your answer in a ticket a little bit later as a proposition)
    Fabian Freund
    @FaFre
    H
    Fabian Freund
    @FaFre
    Hey guys, i have a stream that emits a list of URLs. Now I want to have another stream that listens for the URL lists to fetch and process data from a webservice. However, when a new list of URLs is emitted the current fetch/process should be canceled and the new list should be processed. Only successfully processed jobs will be emitted by the second stream.
    Can somebody give me a hint how to realize that with rxdart?
    Frank Pepermans
    @frankpepermans
    Sounds like switchMap from your description, you basically switch to the other Stream, but when the first one emits again, it cancels and does the switch again with the newest value.
    Lukáš Chábek
    @Lukasas
    Hello, I'd like to ask, I got a stream that pulls data and then a stream that caches them. I need something to start the first stream and when it finishes get the data and start the cache stream. What would be the best approach ? (rxdart)
    Frank Pepermans
    @frankpepermans
    What do you mean exactly?
    Do you need to cache every item from Stream A?
    Fabian Freund
    @FaFre

    Sounds like switchMap from your description, you basically switch to the other Stream, but when the first one emits again, it cancels and does the switch again with the newest value.

    thanks for your suggestion that time, it hit the nail :)

    in the meanwhile I was using rxdart for a lot of things, its really a great library!

    I also like the BehaviorSubject and make more and more use of it. Sometimes I want to 'upgrade' existing streams (I don't have control over) just to gain easy access to the last value.

    I do this like this:

    final gridSubject = BehaviorSubject<List<Grid>>();
    gridStream.pipe(gridSubject);

    I was wondering if this approach is suggested?

    Frank Pepermans
    @frankpepermans
    You can just use shareValue on any Stream, if you want that behavior
    Pranavvks
    @Pranavvks

    Hey everyone , I am running into a value error when passing the behavior subject. I am using the bloc pattern and my requirement here is to pass the stream from the repository layer to the ui layer. Also find attached a link to the minimal reproduction sample : https://github.com/Pranavvks/Ultimate-to-do-minimal-repd.
    ``` BehaviorSubject<DocumentSnapshot<Map<String, dynamic>>> getDailyTasks() {
    var stream = db.collection("Daily_tasks").doc(user!.uid).snapshots();

    (stream.listen((event) {
      print(event.data());
    }));
    
    todoStreamController.sink.addStream(stream);
    
    return todoStreamController;           

    ```

    Frank Pepermans
    @frankpepermans
    Can you share which error you are getting exactly?
    Pranavvks
    @Pranavvks
    @frankpepermans I am receiving a null response this is the error message. Also find attached picture the state of the stream observed while debugging : Link : https://drive.google.com/file/d/12Lc-ZkArOfKB0nwqb_cWJEhCmyGJ4dLg/view?usp=sharing
    Frank Pepermans
    @frankpepermans
    Ok, and the stack trace? Where is value being called?
    Pranavvks
    @Pranavvks
    @frankpepermans The value is called in the UI layer . For the stack trace null value is returned. Link : https://drive.google.com/file/d/1TRa2-U-pRR7tETRQvReXvzKwX40Q0nvu/view?usp=sharing
    Frank Pepermans
    @frankpepermans
    Ok I assumed you were referring to the value property of a BehaviorSubject, but here, it just seems that you Widget just has a null reference to your state manager, but I don't see why this is an rxdart issue?
    Pranavvks
    @Pranavvks
    @frankpepermans Yes I was referring to the value property. I also tested the same with an ordinary stream I am encountering the same issue. So it might not be an rxdart issue , but what am I possibly doing wrong here any suggestions would be of great help.
    Frank Pepermans
    @frankpepermans
    dailyTaskList is nullable, and you are expecting it not to be by using the exclamation mark, so just ensure that widget.dailyTaskList is not null?
    Fabian Freund
    @FaFre

    You can just use shareValue on any Stream, if you want that behavior

    hey it's been a while, but eventually I came back to this. I tried shareValue() instead but for some reasons .hasValue remains false all the time. Is it because I'm not actively listening to the stream?

    Frank Pepermans
    @frankpepermans
    That's very likely, as shareValue is bolted on an existing Stream, it requires a value to pass in that same Stream before it can process it.
    ...and events are only played when something actually subscribes