0

I'm currently building a React Native application and wondering if storing device information such:

  • if my app has granted location permission
  • location service is turned on
  • last known user location

in the Redux store can be a good idea.
I have different components that needs to know this informations and storing in Redux can grant me a predictable state. In the case, maybe I can store them like this:

{
 user: {
 id: '123'
 name: 'Markus'
 ...
 },
 device: {
 locationPermission: 'denied'
 locationActive: false
 lastKnownLocation: {
 lat: 44.123,
 lng: 32.123
 }
 },
 ...
}

Are there any cons about this approach?

asked Jan 9, 2019 at 15:19

1 Answer 1

-1

Yes off course if you are sharing device info between different screens and component, then storing in store is a good option.

answered May 22, 2019 at 11:46

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.