URL State or Global State
Unanswered
Yellow-breasted Chat posted this in #help-forum
Yellow-breasted ChatOP
hello guys, im creating an coolify alternative just for fun and learning . but i have to grab some feedback of different and better ways to do some thing,
there i have the project openened, and each project have 2 default environments, the default one is the production, so when project page loads, the production services are fetched, if i change to development, that fetchs the development services. but for this, for now, im using an zustand store, that i set the current project opened and by default that defines the production env to be selected, and then, my react query, depends on that selectedenvionment and projectId to fetch the data, everytime anything changes, that fetchs the services.
But that is an good aproch? or just should i use URL state, and add the environment selected there, using maybe something like Nuqs.
there i have the project openened, and each project have 2 default environments, the default one is the production, so when project page loads, the production services are fetched, if i change to development, that fetchs the development services. but for this, for now, im using an zustand store, that i set the current project opened and by default that defines the production env to be selected, and then, my react query, depends on that selectedenvionment and projectId to fetch the data, everytime anything changes, that fetchs the services.
But that is an good aproch? or just should i use URL state, and add the environment selected there, using maybe something like Nuqs.