I just added Flow to my Create-React-App project and when converting some of my calculation codes to an input type, I ran into this error with a destructed “object as parameters”
Original whitefish:
calcWeightOnConveyor({ tonsPerHour, conveyorLength, conveyorSpeed })
After stream type:
calcWeightOnConveyor({ tonsPerHour: number, conveyorLength: number, conveyorSpeed: number }): number
And the error:
$ flow Error: src/utils/vortex/calculate.js:31 31: export function calcWeightOnConveyor({ tonsPerHour: number, conveyorLength: number, conveyorSpeed: number }) { ^^^^^^ Strict mode function may not have duplicate parameter names
Is there a way to use a stream with restructuring the object this way or should I redesign these function APIs?
source share