We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
groupBy
Here's a sample usage of groupBy:
it("test", () => { type Foo = { id: number; color: string }; const byColor = groupBy(({ color }) => color, [ { color: "red", id: 1 }, { color: "blue", id: 2 }, { color: "red", id: 3 }, ] as Foo[]); Object.values(byColor).map((grouping: Foo[]) => { console.log(grouping); }); });
which triggers this error:
The map parameter needs to be supplied with Foo[] | undefined to work correctly, even though that's not the right type.
map
Foo[] | undefined
Removing the Partial wrapping the return type would fix this DX issue... I'm wondering what is the rationale for providing a partial record type?
Partial
The text was updated successfully, but these errors were encountered:
The suggestion to add the Partial<> was made and merged in this MR: #45
Partial<>
Your issue has already been brought up and resolved. Please see here: #91
Sorry, something went wrong.
Oh, sorry I didn't search for groupBy in the issues before posting! My bad, and thanks for the response. I'll move any subsequent questions there.
No branches or pull requests
Here's a sample usage of
groupBy
:which triggers this error:
The
map
parameter needs to be supplied withFoo[] | undefined
to work correctly, even though that's not the right type.Removing the
Partial
wrapping the return type would fix this DX issue... I'm wondering what is the rationale for providing a partial record type?The text was updated successfully, but these errors were encountered: