I'm recently new using Redux and I wanted to create a simple app with it. I already did the main structure with my own State, Reducer and Action implementation.
But I'm wondering how can I add the "data" part to the application using Firebase. With this I mean which can be the best practice to structure and externalize the data calls following the pattern of application State of Redux. I already thinked about create a controller and dispatch actions which call the data, but Firebase use a lot of callbacks so I don't find a good way to manage them all following this pattern.
What good practices are there to structure data model in an Android application following the Redux pattern?
I've been working through this in one of my own apps, using Redux and Firebase. What I've used is something akin to what is described in this blog post on making a react, redux, firebase app with auth.
Basically, you create actions that start the listening to changes in the Firebase data and then when they get those changes they dispatch the new data with an appropriate action (CREATE_ENTITY, UPDATE_ENTITY, DELETE_ENTITY, etc) so that you can make the correct changes in your reducers.
These actions are called when your app starts up since they are needed in order to listen to all data changes in Firebase.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With