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

Invert KeyValueEventHandler parameters in MapSchema #141

Open
rthery opened this issue Apr 10, 2021 · 0 comments
Open

Invert KeyValueEventHandler parameters in MapSchema #141

rthery opened this issue Apr 10, 2021 · 0 comments

Comments

@rthery
Copy link

rthery commented Apr 10, 2021

public event KeyValueEventHandler<T, string> OnAdd;
public event KeyValueEventHandler<T, string> OnChange;
public event KeyValueEventHandler<T, string> OnRemove;

MapSchema uses string then T everwhere except for these events. Because of this inversion, it means we can't just directly call handlers for these events with other MapSchema methods, like ForEach, so you end up having to write
mapSchemaInstance.Foreach((key, t) => OnAdd(t, key)) instead of a nicer mapSchemaInstance.Foreach(OnAdd)

I know it's a breaking chance, but it would just be more coherent and help with readability (I haven't checked other collections, may need to update them as well)

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