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?

lellefood
  • 119
  • 5

1 Answers1

-1

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