attempting to do:
Contexts/Promises is an app.tsx wrapping that provides functions and redux changing state
(since .ts cant: usehooks cant be called in that function)
this issue bookmarks a question about how to go about this in the most sensible way.
error:
// no errors both approaches will work:
pictured above, i've already commented out: SET_HYDRO_DATA && SET_DATE
(I believe /dashboard needs this data and that won't hurt anything to set those useless states when returning the getDailyData)
but would still like to separate.
| split | decisions | :
I now want to make a Promise that takes all boolean params for possible data to set.
this will reduce the redundancy of calling the same getDailyData promise
(which is already redis cached so somewhat performant)
the question is whether this intrudes upon "single responsibility" as this function will essentially be performing multiple tasks.
but will it be?
these next few promises will take that same getDailyDataPROMISE() return data which is prisma.data.findMany()
(or redis cache of same)
and SET_REDUX_STATE.
in this case, the data will be called once per page (/index.tsx && /dashboard.tsx) and sounds more like it makes sense
attempting to do: Contexts/Promises is an app.tsx wrapping that provides functions and redux changing state
(since .ts cant: usehooks cant be called in that function)
this issue bookmarks a question about how to go about this in the most sensible way.
error: // no errors both approaches will work:
pictured above, i've already commented out: SET_HYDRO_DATA && SET_DATE
(I believe /dashboard needs this data and that won't hurt anything to set those useless states when returning the getDailyData)
but would still like to separate.
| split | decisions | : I now want to make a Promise that takes all boolean params for possible data to set. this will reduce the redundancy of calling the same getDailyData promise (which is already redis cached so somewhat performant) the question is whether this intrudes upon "single responsibility" as this function will essentially be performing multiple tasks.
but will it be? these next few promises will take that same getDailyDataPROMISE() return data which is prisma.data.findMany() (or redis cache of same)
and SET_REDUX_STATE.
in this case, the data will be called once per page (/index.tsx && /dashboard.tsx) and sounds more like it makes sense