ngxs-labs / firestore-plugin

Firestore plugin for NGXS
https://ngxs-firebase-plugin.netlify.com/
MIT License
20 stars 14 forks source link

Doc: How to run queries #8

Closed verygreenboi closed 4 years ago

verygreenboi commented 4 years ago

Thanks for this library. I was wondering how I can listen to a specific document rather than a collection?

joaqcid commented 4 years ago

hi @verygreenboi just updated docs with an example to query a specific doc

you need to setup the connection like this

this.ngxsFirestoreConnect.connect(RacesActions.Get, {
      to: (action) => this.racesFS.doc$(action.payload)
 });

and dispatch the action

this.store.dispatch(new RacesActions.Get(id));