Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
KristofferStrube opened this issue Oct 29, 2024 · 0 comments

Comments

@KristofferStrube
Copy link
Owner

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
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant