Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Johan Larsson
    @JohanLarsson
    thought about it
    Dorus
    @Dorus
    In RxJs they have Pairwise as operator name.
    Johan Larsson
    @JohanLarsson
    it is probably better as it suggests order
    Dorus
    @Dorus
    https://rxjs.dev/api/operators/pairwise
    But it just returns an array. They didn't name it.
    Johan Larsson
    @JohanLarsson
    My thinking was Pair() -> Paired<T> like Timestamp() -> Timestamped<T> but was not super happy with it.
    Dorus
    @Dorus
    I would use Pair<T> and Timestamp<T>, but then your operator and type have the same name. Is that a problem?
    Johan Larsson
    @JohanLarsson
    Pair() is not awesome either
    Dorus
    @Dorus
    Pairwise() : Observable<Pair<T>>?
    Johan Larsson
    @JohanLarsson
    probably better
    or Pairwise() : Observable<Pairwised<T>>
    Pair<T> is not ideal as a public type with fields Current and Previous
    Dorus
    @Dorus
    Idk if i like verb type names.
    Yeah but Pairwised doesn't improve that.
    Dorus
    @Dorus
    interesting
    Johan Larsson
    @JohanLarsson
    ^ is the reason I'm going on about Paired<T> stay consistent with the framework
    Dorus
    @Dorus
    But then you can write almost all your types in paste tense.
    But it's not wrong since we work with async data. Mmmm
    I can agree with consistency.
    aka Observable<Timestamp<T>> timestamp(this Observable<T> source, IScheduler scheduler) in C#
    Adam Buchanan
    @RejectKid
    @Dorus Perfect thank you!
    RedlineTriad
    @RedlineTriad
    Is there an easier way to return the last element of an Observable on subscribe other than wrapping than wrapping it in a BehaviourSubject?
    José Manuel Nieto
    @SuperJMN
    I don't think so :(
    Dorus
    @Dorus
    @SuperJMN I think you can ;-)
    José Manuel Nieto
    @SuperJMN
    Oh, yes, now that you say! Sorry, I'm such a pessimistic person sometimes ! haha
    RedlineTriad
    @RedlineTriad
    @Dorus wouldn't that return all the previous ones? i only want the most recent.
    Dorus
    @Dorus
    @RedlineTriad You can pass in the buffer size. Set it to 1.

    See

    Replay<TSource>(IObservable<TSource>, Int32)
    Returns a connectable observable sequence that shares a single subscription to the underlying sequence replaying bufferSize notifications.

    RedlineTriad
    @RedlineTriad
    Ah, yep, that sound like what i want.
    Dorus
    @Dorus

    Another interesting you could sometimes use is

    Replay<TSource, TResult>(IObservable<TSource>, Func<IObservable<TSource>, IObservable<TResult>>, Int32)
    Returns an observable sequence that is the result of invoking the selector on a connectable observable sequence that shares a single subscription to the underlying sequence replaying bufferSize notifications.

    You call it with source.Replay((src) => { ... }, 1)
    (src) => { ... } here is the selector function and inside there nyouy can use src as many times as you want and it will replay the latest value each time you subscribe to it, but after Replay you have a normal Observable instead of ConnectableObservable that you need to connect to etc.

    For example source.Replay(src => src.concat(src)) will emit source like normal, but replay the last value on complete.

    @RedlineTriad
    RedlineTriad
    @RedlineTriad
    Sounds nice, but I don't understand half of it, I am currently at the level where I still have memory leaks.
    Bartolomeus-649
    @Bartolomeus-649

    What is the status of reactive programming in c#/.net?

    1. Is there a "native" reactive technology that goes beyond System.Observable, and which is fully supported, maintained and actively being developed by Microsoft?
    2. One could get the impression that https://github.com/dotnet/reactive is the current and active repo on Github, but on that page it say "Join the conversation" and links to: http://reactiveui.net/slack.
      Ones there the latest message is from 2015 and the the channel is called "#dont-talk-in-here".
    3. When you check out Microsofts documentation for Reactive Extensions) it is from 2011 and has huge warning that the content is no longer updated.
    4. On ReactiveUI.net there's a blog post from 2018 indicating that System.Reactive is abandoned by Microsoft, and superseded by something called "Reactor".

    All these things combined makes my customers confused about the status of reactive programming in .NET and unless I find and point them to clear, concise and unambiguous resources which ensures that Microsoft is behind the technology, actively developing and supporting it and that is has a road-map where it show that it is a core part of the .NET Framework for many versions to come.

    They were burned by Microsoft abandoning both Silverlight and LightSwitch.

    Dorus
    @Dorus
    @Bartolomeus-649 The slack space has more channels, including one #rxnet that does seem to be more active.
    Cannot help you with the remaining concerns, i would be interested in the answers as well.
    Rich Bryant
    @richbryant
    @Bartolomeus-649 the core System namespace defines IObservable<T> and IObserver<T>. Rx.net is, as the name implies, a set of extensions and implementations thereof. It is not (anymore) a Microsoft-run library although many MS staff including Oren still work on it and it's widely used within MS. Think of it like Json.net which became ubiquitous in MS stuff even though it was always OSS.
    If that makes your clients twitchy, well, I guess no decent streaming for you.