Is it a good idea to access Firebase via a direct connection vs utilising Firebase in a store via Redux?
I have some example code here to show how I implemented a direct firebase connection and used it to query data in a Component:
import firebase from './src/firebase.conn';
class App extends React.Component {
constructor(){
super();
this.state = {
orders: []
};
this.getOrders = this.getOrders.bind(this);
}
componentDidMount() {
this.getOrders();
}
async getOrders() {
try {
let orders = await (await firebase.database().ref('orders)).val();
this.setState({orders})
} catch (e) {
console.error(e)
}
}
Is it feasible to build an app with a direct firebase connection? Or should I build the app with a Firebase/Redux implementation like react-redux-firebase (https://github.com/prescottprue/react-redux-firebase)