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
https://codesandbox.io/s/competent-star-g4nqnp?file=/src/App.tsx
import { entries, fromEntries, groupBy, map, pipe, reduce } from "@fxts/core"; import "./styles.css"; type DataSet = { status: Status; count: number; }; enum Status { Todo = "TODO", InProgress = "IN_PROGRESS", Done = "DONE" } const data: Array<DataSet> = [ { status: Status.Todo, count: 0 }, { status: Status.InProgress, count: 0 } ]; export default function App() { pipe( data, map((item) => { return { progress: Status.Done, count: item.count }; }), groupBy((item) => item.progress), entries, map(([progress, values]) => { return [ progress, reduce((acc, cur) => acc + cur.count, 0, values) // <-- Type Error: values ] as const; }), fromEntries ); return null; }
TypeScript Inference is not working.
TypeScript Inference works.
@fxts/[email protected]: fine. @fxts/[email protected]: bug occur.
Maybe #199 side effect.
The text was updated successfully, but these errors were encountered:
@hg-pyun
First If you change the function which inner reduce below, you can use it. but I think improvement is needed.
reduce
reduce((acc:number, cur:{count:number}) => acc + cur.count, 0, values)
Sorry, something went wrong.
No branches or pull requests
Bug Report
💻 Code
https://codesandbox.io/s/competent-star-g4nqnp?file=/src/App.tsx
🙁 Actual behavior
TypeScript Inference is not working.
🙂 Expected behavior
TypeScript Inference works.
Version Information
@fxts/[email protected]: fine.
@fxts/[email protected]: bug occur.
Maybe #199 side effect.
The text was updated successfully, but these errors were encountered: