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

Add helper method to register multiple local callbacks #29

Open
tupini07 opened this issue Nov 13, 2020 · 0 comments
Open

Add helper method to register multiple local callbacks #29

tupini07 opened this issue Nov 13, 2020 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@tupini07
Copy link
Contributor

tupini07 commented Nov 13, 2020

In many cases, we want to register multiple events, each with its own callback. Currently, we need to do a call to RegisterLocal for each pair we want to register.

An easier way that would allow us to avoid repetition would be to add a method that receives an array of pairs and calls RegisterLocal. For example, we could implement it as an overload of the RegisterLocal:

RegisterLocal(List<Pair<string, callback>> items) {
  foreach (event, callback) in items {
    RegisterLocal(event, callback)
  }
}

As an idea, we could also implement a similar method to register multiple local reply callbacks (we should wait for #28 to be closed in that case).

As a note: we could replace the current RegisterLocal with this one.

@tupini07 tupini07 added enhancement New feature or request good first issue Good for newcomers labels Nov 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant