thermobased / flask-webapp

0 stars 0 forks source link

Collection in TypeScript code is untyped #4

Closed gnull closed 4 months ago

gnull commented 5 months ago

https://github.com/thermobased/flask-webapp/blob/81c298458ab0eab9add77629529f26d965e36183/frontend/render_remove_habit.ts#L1

https://github.com/thermobased/flask-webapp/blob/81c298458ab0eab9add77629529f26d965e36183/frontend/render_remove_datapoint.ts#L1

https://github.com/thermobased/flask-webapp/blob/81c298458ab0eab9add77629529f26d965e36183/frontend/render_calendar.ts#L3

We can declare the type of this variable and have TS help us avoid mistakes when working with it. Furthermore, we can move this duplicated declaration of collection into a separate file and just import it from all three locations. This way, we reduce the room for mistakes and make it easier to adjust the type of collection later (if needed).

Also: see if we need to do the same for other variables declared next to collection.

Ivan

thermobased commented 4 months ago

fixed by d3dc48f and 2cb1625