Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7534335
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T05:59:09+00:00 2026-05-30T05:59:09+00:00

I have a hot observable (from an event) that I’m calling DistinctUntilChanged on which

  • 0

I have a hot observable (from an event) that I’m calling DistinctUntilChanged on which will have multiple subscribers who will subscribe at different times after the observable has started running and produced its first value. Subscribers will get getting the IObservable through a property on my class.

How do I make it so that each time someone subscribes to the observable they get the last value published but the observable acts normally otherwise? I think I might be looking for PublishLast but I’m not sure if it has other side effects.

Similar question: How do I get an IObservable to push the newest value upon subscription? This is a very similar question but it’s from over a year ago and a lot of additions have been made to Rx so I think there might be a built-in function now rather than having to rely on a BehaviorSubject so I don’t think this is an exact duplicate.

Edit: Here is what I’m actually trying to do. There’s a comment below the actual observable sequence I’m talking about.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T05:59:10+00:00Added an answer on May 30, 2026 at 5:59 am

    The other answer was close. You either want a ReplaySubject(1) ie only replay 1 value; or you want a BehaviorSubject. The difference is a Behavior Subject will require a default value. This will also guarantee that the subscriber will always get a value immediately.

    var replay1 = source.Replay(1);
    replay1.Connect();
    //Or
    var alwaysHaveValue = source.Multicast(new BehaviorSubject<int>(-1));
    

    To understand each of the Subjects check out my Intro to Rx post

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I have a web app which uses all the hot keys from A
I have a C# app that needs to do a hot swap of a
A have a C# class which simplifies the handling of global hot keys. This
I have a class with dependencies which I want to hot deploy without restarting
I have a couple of lines in my .htaccess that block hot linking of
I'm using AutoHotKey which is a program that lets me define my own hot
I have been working on a C# WinForms application that registers several hot keys
I have a one-hot line that I want to use to select a range
I have a RichTextBox in .NET WinForms. I have been hooking up hot keys
Have just started using Visual Studio Professional's built-in unit testing features, which as I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.