This store is responsible for holding all the data and logic surrounding chats and messages, but it also helps the chats store initializing when a user is logged in:
/*** src/stores/chats.js ***/import { observable, computed, map, toJS, action } from 'mobx'; import { AsyncStorage } from 'react-native' import { firebaseApp } from '../firebase' import notifications from '../notifications' class Chats { @observable list; @observable selectedChatMessages; @observable downloadingChats = false; @observable downloadingChat = false; @action addMessages = function(chatId, contactId, messages) { //add a list of messages to a chat } @action selectChat = function(id) { //set a chat as selected and retrieve all the messages for it } @action ...