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 7740415
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T08:46:23+00:00 2026-06-01T08:46:23+00:00

Anyone have example Rx code that shows how to execute an action due to

  • 0

Anyone have example Rx code that shows how to execute an action due to a delayed event that is cancelled by another event? Such as, displaying a tooltip when hovering over a button for a certain period of time?

The action is “display tooltip”

The duration is the “certain period of time”

And the cancellation event would be “mouse out” if the mouse stops hovering over the button.

Thanks!

  • 1 1 Answer
  • 1 View
  • 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-06-01T08:46:24+00:00Added an answer on June 1, 2026 at 8:46 am

    Always start by breaking down the problem into what you have and what you want, turn that into a function signature, and see if that reveals an implementation.

    execute an action due to a delayed event that is cancelled by another event

    so you have a trigger source, a delay duration, and a cancellation source

    The desired behavior you describe is:

    • For each source trigger
    • Delay for a specified time
    • If no cancel happens during that time, yield the original value

    Now that we have the spec, we can make a signature and consider an implementation

    ??? DelayOrCancel<???>(this IObservable<T> source, 
                           TimeSpan delay, 
                           IObservable<TCancel> cancel);
    

    Depending on the nature of the cancellation source, you could need to pass Func<T, IObservable<TCancel>>, but it sounds like this will work in your case.

    The first two lines of the spec suggest SelectMany (each item in the source makes another observable that will be combined back to a single observable). To get the cancellation, we just need to wait for the delay or until a cancellation, which we can do with TakeUntil. Since the final items will be the source items, the return type will be the same as the source.

    IObservable<T> DelayOrCancel<T, TCancel>(this IObservable<T> source, 
                                             TimeSpan delay, 
                                             IObservable<TCancel> cancel)
    {
        //argument checking skipped
        return from s in source
               from i in Observable.Timer(delay).TakeUntil(cancel)
               select s;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Question: Can anyone please provide a full code example that shows how one does
Anyone have sugestion or example on how displaying Google Datastore records table with pagination
Can anyone give me the example code that I can use to first present
Anyone have an example snippet showing how to scale a Font using AffineTransform? Thanks.
Does anyone have an example of setting up Authlogic with a namespace in Rails?
Does anyone have any example on how to put a date time picker inside
Does anyone have an example of rendering a remote file in XTK (https://github.com/xtk/X)? Is
Question: Does anyone have an example of a filter as you type dropdown control
Anyone have an minimal example of ASP.NET MVC and dotnetcharting.com control lying around? Thanks,
Does anyone have a smal example of how to programmatically, in c/c++, load a

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.