IjzerenHein / firestorter

Use Google Firestore in React with zero effort, using MobX 🤘
http://firestorter.com
MIT License
378 stars 50 forks source link

using a mobx store #28

Closed joshua1 closed 5 years ago

joshua1 commented 6 years ago

Hi @IjzerenHein given the use of a store in the docs https://github.com/IjzerenHein/firestorter/blob/master/docs/Store.md any chance this store can be a mobx store so that one can have shared computed functions and shared actions that process the defined collections. something like

const store =observable( {
  artists: new Collection('artists'),
  get youngArtist(){
        return this.artist.ref.....
},
updateArtists(){
   this.artist.....
}
});

just so you have multiple computed values, available to several components. instead of having several instances of same collections with different query property specified for each.

IjzerenHein commented 6 years ago

Hi Joshua, yes definitely. I guess the store itself doesn't need to be observable, but you can definitely make the contents inside of it observable.