C
C#16mo ago
Alex Frost

❔ Delayed call to a function

I am writing search in Blazor and the search needs to happen without enter or tab press. What I want is for a timer to be incremented on each key-press and once typing stops and delay is achieved, it should call the function. Few of the methods I tried call the search many times.
3 Replies
phaseshift
phaseshift16mo ago
use a timer, update the interval properly. Or stop the previous timer and make a new one
JakenVeina
JakenVeina16mo ago
if you wanna go REALLY crazy
IObservable<string> textBoxValueChanged = ...;

var subscription = textBoxValueChanged
.Debounce(TimeSpan.FromSeconds(1))
.Subscribe(textBoxValue => PerformSearch(textBoxValue));
IObservable<string> textBoxValueChanged = ...;

var subscription = textBoxValueChanged
.Debounce(TimeSpan.FromSeconds(1))
.Subscribe(textBoxValue => PerformSearch(textBoxValue));
Accord
Accord15mo ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server
More Posts
❔ [MVC/RazorPages] Why can't I access model data?If I try printing to console the form data that I've `[BindProperty] ` on the OnPost() method, it co❔ async void in event handler (window "OnClosing" event)I have this code here which obviously shouldn't work due to how async void and Task.Delay naturally ❔ trying to get my Dialog system to be with a key press and not just walking into the npc, unity 2dI've been trying for awhile now to make it so it works but, everything I do doesn't work. I have a❔ Differenct action names is not working ASP.NET Corehttps://stackoverflow.com/questions/76006309/different-action-names-are-not-working-in-asp-net-core-❔ how to deploy asp.net project to ec2 linux server using github actions with dockerHi guys i want to deploy my api project (.net 6) to ec2 server (linux) with github actions and it wi❔ WPF Date entry Forms MVVMHello, I don't understand in WPF when I should use MVVM and when I shouldn't. For example, i'm loadi❔ Access appsettings.json in ASP.NET Web API in Azure published App Servicehttps://stackoverflow.com/questions/76005641/azure-hosted-asp-net-web-api-cannot-access-appsettings-❔ Akka.net Actors are not responding in timeI have a system that consists of two Actor classes and a class that calls these actors. ```cs publi✅ DialogResult and MessageBox in class (namespace)Hi, I have a class library and wanted to know if its possible to add a dialog result and message boxParsing an arbitrary file path as a Uri or similarHello there. I would like to be able to parse the following inputs in such a way that I'm aware if t