feature(BuildCalc) Added reset button, can change micro delay, and can alter timing interval again

This commit is contained in:
2022-04-14 22:28:14 -04:00
parent 4cef578cd0
commit 04c1718259
115 changed files with 1561 additions and 1308 deletions
+7 -8
View File
@@ -5,9 +5,8 @@
@if (toastService.HasToasts())
{
<div class="toastsContainer">
@foreach(var toast in Toasts)
@foreach (var toast in Toasts)
{
<ToastComponent Toast="toast"/>
}
</div>
@@ -27,25 +26,24 @@
@code {
private List<ToastModel> Toasts => toastService.GetToasts();
private Timer ageTimer = null!;
protected override void OnInitialized()
{
toastService.Subscribe(OnUpdate);
ageTimer = new Timer(10);
ageTimer.Elapsed += OnAge!;
ageTimer.Enabled = true;
}
public void Dispose()
{
toastService.Unsubscribe(OnUpdate);
}
void OnAge(object? sender, ElapsedEventArgs elapsedEventArgs)
{
toastService.AgeToasts();
@@ -57,4 +55,5 @@
{
StateHasChanged();
}
}