firestoreConnect(props => [
{ collection: "matches", doc: props.match.params.matchId },
{
collection: "matches",
doc: props.match.params.matchId,
subcollections: [{ collection: "firstInningsBatting" }]
},
{
collection: "matches",
doc: props.match.params.matchId,
subcollections: [{ collection: "secondInningsBatting" }]
},
{
collection: "matches",
doc: props.match.params.matchId,
subcollections: [{ collection: "firstInningsScore" }]
},
{
collection: "matches",
doc: props.match.params.matchId,
subcollections: [{ collection: "secondInningsScore" }]
}
])
firestoreConnect(props => [{ collection: `petParents/${props.profile.ppid}/pets`, storeAs: "pets" }]),
connect(state => ({
pets: state.firestore.ordered.pets
})),
connect((state, props) => ({
initialValues: {
contactInfo: {...state.firebase.profile.contactInfo},
vetInfo: {...state.firebase.profile.vetInfo},
emergencyContacts: [...state.firebase.profile.emergencyContacts]
}
}))
react-waypoint
is a cool library but I'm already using react-virtualized
. Sorry for being unclear. My issue concerns needing a different storeAs
name for every page of listeners because, without it, each listener call overwrites the results from the previous page/listener. So, my workaround is to use storeAs
and create a unique store name for each listener. For example, I store the first page in storeAs: 'items.0'
, 2nd batch in storeAs: 'items.1'
, 3rd in storeAs: 'items.2'
, and so on. I'd rather be able to store all listener results in storeAs: 'items'
, which makes my mapStateToProps
simple: items: state.firestore.ordered.items || []
. Otherwise I have to reduce all the state.firestore.ordered.items.n
stores into items
. I'm using reselect
to memoize this, but it would be nicer if each page of listeners could just append the new page of items to state.firestore.ordered.items
rather than using a different storeAs
for each listener. Is that possible using a config option like mergeOrdered
, allowMultipleListeners
, or oneListenerPerPath
?
@prescottprue is there anything like profileParamsToListen
in react-redux-firebase
?
I want to add global listener to the app on connections/${profile.connectionId}
node in database.
There is profileParamsToPopulate
Api. The thing is that it doesn't listen some prop under profile continually, but only populates it once on every profile update.