ModelStore
The ModelStore stores models, and exposes queries to access documents from the document instance. The ModelStore should be accessed as a singleton, and can be considered the document source.
Initialization
The ModelStore takes the default Model, property name where documents should reside, and the PouchDB instance.
import { ModelStore } from 'mobx-pouchdb';
import PouchDB from 'pouchdb';
import ToDoModel from './todomodel';
const todoPouch = new PouchDB('todo');
export class ToDoModelStore extends ModelStore {
constructor() {
super('todos', ToDoModel, todoPouch);
}
}
export default new ToDoModelStore();