redux-react-firebase
redux-react-firebase copied to clipboard
Using both state and { firebase } inside connect
@firebase(....) @connect( (state, { firebase }) => ({ home: state.get('home'), todos: dataToJS(firebase, '/todos') }) ) export default App extends Component{ ..... }
Can I use the repo like this? or @firebase is going to interfere with the state of @connect
@beckmeindia the firebase node is on state, so you could do
@firebase(....)
@connect( (state) => ({ home: state.get('home'), todos: dataToJS(state.firebase, '/todos') }) )
export default App extends Component{
.....
}
or
@firebase(....)
@connect( ({ firebase, get }) => ({ home: get('home'), todos: dataToJS(firebase, '/todos') }) )
export default App extends Component{
.....
}