frankcollins3 / Next-Water-App

Happy, Healthy Water Cycling App that tracks user/human fluid intake.
https://next-water-app.vercel.app
1 stars 0 forks source link

modularizing all Promises [2:00pm] #76

Closed frankcollins3 closed 11 months ago

frankcollins3 commented 11 months ago

attempting to do: create method from which a central store for all app promises may be housed.

error: 1: the amount of promises deal with state 1.1: which in @redux/toolkit usage depends on useDispatch() which is a hook which needs .tsx rather than .ts (usage would depend on the format of which {useContextImageBank} or {useContextRegexExpressionBank} does. // the resolve value would be set as states and the promise would set state to be that value

proposed approach:

frankcollins3 commented 11 months ago

giving a go. reporting notes: in {useContext} based "state" both state and setState are used. // read && write in {ImageContext} & {RegexContext} -> setState() never used. just the expressions & values themselves // read only

in a promise based state it looks like neither [state, setState()] will be used. just to declare functions that execute and return values.

// just starting though that may not be the case 5 minutes from now

[2:13pm]

frankcollins3 commented 11 months ago

might be wrong. unless we can use the same const to export the promise the promise will have to change state. the exported values={} will be fussing that the promise isn't the values or defined values

Screen Shot 2023-07-21 at 2 17 03 PM

[2:18pm]

frankcollins3 commented 11 months ago

THIS WORKS! [2:49pm]

frankcollins3 commented 11 months ago

probably won't run back and do this for all promises but for next app definitely.