theelims / ESP32-sveltekit

A simple and extensible framework for ESP32 based IoT projects with a feature-rich, beautiful, and responsive front-end build with Sveltekit, Tailwind CSS and DaisyUI. This is a project template to get you started in no time with a fully integrated build chain.
https://theelims.github.io/ESP32-sveltekit/
Other
118 stars 22 forks source link

Moves model types to type file #37

Closed runeharlyk closed 8 months ago

runeharlyk commented 8 months ago

Purpose

Collects all types sent between server and browser. This makes it easier to use the type elsewhere

Changes

theelims commented 8 months ago

@runeharlyk What is the purpose of this PR? Why is it beneficial to do it this way?

runeharlyk commented 8 months ago

It will making new communication services simpler as we can reuse the types. I think it will also make it easier to get a overview of the data the server can supply.

Specifically I'm currently making a single socket service. This would also benefit from the types being available everywhere. They would then get used by both the rest API and sockets which can be at different parts of the interface code.

What do you think?

theelims commented 8 months ago

Okay, I understand.

I'm also working on the single websocket solution right now. Maybe we can align on this. There is no need to do work twice.