Skip to content

Commit

Permalink
Changed ModalService events from Action to Func (#424)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrissainty authored Aug 29, 2022
1 parent 7f9f7eb commit f5a0750
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/Blazored.Modal/BlazoredModal.razor
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
}
}

internal async void CloseInstance(ModalReference? modal, ModalResult result)
internal async Task CloseInstance(ModalReference? modal, ModalResult result)
{
if (modal?.ModalInstanceRef != null)
{
Expand Down Expand Up @@ -122,7 +122,7 @@
await InvokeAsync(StateHasChanged);
}

private async void Update(ModalReference modalReference)
private async Task Update(ModalReference modalReference)
{
_modals.Add(modalReference);

Expand Down
4 changes: 2 additions & 2 deletions src/Blazored.Modal/Services/ModalService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ namespace Blazored.Modal.Services;

public class ModalService : IModalService
{
internal event Action<ModalReference>? OnModalInstanceAdded;
internal event Action<ModalReference, ModalResult>? OnModalCloseRequested;
internal event Func<ModalReference, Task>? OnModalInstanceAdded;
internal event Func<ModalReference, ModalResult, Task>? OnModalCloseRequested;

/// <summary>
/// Shows the modal with the component type.
Expand Down

0 comments on commit f5a0750

Please sign in to comment.