js-jslog / harpnative

A port of the harpguru project to react native
0 stars 0 forks source link

Take advantage of global state for the ubiquitus state properties #40

Closed js-jslog closed 4 years ago

js-jslog commented 4 years ago

https://medium.com/@Charles_Stover/optimal-file-structure-for-react-applications-f3e35ad0a145 mentions ReactN.

robinwieruch.de/react-context/ describes the legitimate use of react-contexts in conjunction with hooks to achieve global state.

https://medium.com/@rossbulat/the-future-of-react-reducers-and-global-state-management-30cda8a3b082 goes further.

Here are some articles which are a bit more recent:

Splitting hooks from container code is also something mentioned in the first article and it is described in the second article in some more detail. I think this is something which I could benefit from in the menu state management at least.

js-jslog commented 4 years ago

Articles on how to test with ReactN global state:

js-jslog commented 4 years ago

This is going to be completed over several pull requests. The first is https://github.com/js-jslog/harpnative/pull/44 where we are putting the activeHarpStrata in to global state.

js-jslog commented 4 years ago

A comment left in #49 is eligible for fixing in relation to this issue: https://github.com/js-jslog/harpnative/pull/49#discussion_r460059194

js-jslog commented 4 years ago

https://github.com/js-jslog/harpnative/pull/50 has introduced the global state for activeDisplayMode which is the last of the "ubiquitus state properties" to be converted I think.

I've just spotted that https://github.com/js-jslog/harpnative/issues/40#issuecomment-663546350 above hasn't been caught yet in this last pull request so I had better make that change before merging.

js-jslog commented 4 years ago

We can consider this issue closed on the basis that the untidiness which remains will be covered off in #45

Some of the articles mentioned here will still be of use in #45 but of course #45 has references to this issue so the articles are still easy to rediscover.

I've left a couple of comments to help me find my way back here: