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

Rename entity addAll to replaceAll #2330

Closed
elvisun opened this issue Jan 23, 2020 · 7 comments · Fixed by #2348
Closed

Rename entity addAll to replaceAll #2330

elvisun opened this issue Jan 23, 2020 · 7 comments · Fixed by #2348

Comments

@elvisun
Copy link
Contributor

elvisun commented Jan 23, 2020

Describe any alternatives/workarounds you're currently using

This is what addAll documentation says:

addAll: Replace current collection with provided collection

Then this really should be called replaceAll so people know their existing entities are being removed.

If accepted, I would be willing to submit a PR for this feature

[x] Yes (Assistance is provided if you need help submitting a pull request)
[ ] No

@elvisun
Copy link
Contributor Author

elvisun commented Jan 23, 2020

@alex-okrushko

@alex-okrushko
Copy link
Member

Yeah, we had a case where addAll was used by accident instead of addMany and that lead to hours of debugging 😵

@alex-okrushko
Copy link
Member

Maybe alias replaceAll to addAll and depreciate it?
removeAll can also be renamed to clearAll, but it's less error-prone, I think.

@leon-marzahn
Copy link
Contributor

I don't know, i like addAll 😢 . Or at least don't use replaceAll but setAll instead, makes it easier to write 👍

@alex-okrushko alex-okrushko added Need Discussion Request For Comment needs input and removed Google Internal labels Jan 24, 2020
@timdeschryver
Copy link
Member

👍 for setAll if we're going to rename this.

@alex-okrushko
Copy link
Member

@brandonroberts @MikeRyanDev any thoughts on this? It wasn't the first time 🕵️‍♀️

@brandonroberts
Copy link
Member

Sounds good to me. Let's introduce the new one, and deprecate the old one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants