Blazor.DOM icon indicating copy to clipboard operation
Blazor.DOM copied to clipboard

`AbortSignal.AddOnAbortEventListener` method should take `EventListener` as argument and return `Task`

Open KristofferStrube opened this issue 1 year ago • 0 comments

Currently, this is the signature of AddOnAbortEventListener:

public async Task<EventListener<Event>> AddOnAbortEventListener(
    Func<Event, Task> callback,
    AddEventListenerOptions? options = null
)

But we want to standardize our event methods to only take event listeners directly to give the users of this library and dependant libraries more control over when they want to add new event listeners.

So instead we should have the following new signature for the method and obsolete the old method implementation with the argument that this overload gives better options for controlling memory allocation.

public async Task AddOnAbortEventListener(
    EventListener<Event> callback,
    AddEventListenerOptions? options = null
)

KristofferStrube avatar Oct 29 '24 00:10 KristofferStrube