chingu-voyage3 / bears-21

Hissues
https://hissues.herokuapp.com/
6 stars 0 forks source link

investigate api data shape #18

Open nikrb opened 6 years ago

nikrb commented 6 years ago

investigate data format for api comms.

checkout twilio to see how they do it. useful link: redux dox normalizr with redux

nikrb commented 6 years ago

changed feature to enhancement ... whilst we are here to learn, currently feeling well out of my depth.

How will reselect work with service worker? They both cache request data?

nikrb commented 6 years ago

is it sufficient to have single global redux state for working and error, or does each 'module' require their own? Strictly speaking this is just frontend and not api related.

vivekimsit commented 6 years ago

As far as I know your app should have only single state tree.

nikrb commented 6 years ago

agreed. Does that tree have one global for working type situations and errors, or should each sub-tree have its own? e.g.

{
isWorking: false,
hasErrored: { false, message:""},
user: { ... },
houses: { ... },
...
}

OR

{
user: { isWorking: false, hasErrored: {false, message: "", userData: {...}},
houses: { isWorking: false, hasErrored: {false, message: "", housesData: {...}},
}
...
Mortuie commented 5 years ago

@nikrb 2nd one. Otherwise how do you differentiate the errors :( Although the user will probably be only using one of the state trees.... Idk?