Project NodeTree (5 Part Series)
I missed a week, sorry about that, but now I'm back. I didn't do too much this time. I've made a JS Router, or at least I think that's what you'd call it, to handle different 'states' also I've started making the actual editor with a way to select your Database and table.
If you'd like to follow along with my journey here is my post index.
As you can, hopefully, see I've added a new 'state' this pulls in some more HTML to overwrite what's there already, but I'll go into that later.
The space over to the right will have a table of results and the query input box.
Here's a close look at the selection menu
I'm still not sure this qualifies as a router. It has a state and depending on the state will load a different HTML file into the body of the page.
I have no idea if this is a good idea, it seems fast enough I've been keeping an eye on my lighthouse score, again no idea if that's useful, and it's all green at the moment.
The idea behind this state router is to change the page without updating it, I know this means the back button is now defunct so I might look into that next week.
The syntax is quite simple I just have to call
setState with the state name as the argument and class deals with the rest.
const stateHelper = new SimpleStateRouter(); stateHelper.setState('database');
I've done a couple of other little bits like adding a material toast class and the styling for it. My git repository is up to date now so feel free to take a look and leave issues with suggestions if you like.
Thanks for reading, please don't be shy to comment, even if it's just to tell me I'm doing it all wrong 😅
Thanks again 🦄🦄🦄