Exploring PouchDB within an Angular5 project is my current focus. The pouchdb plugins I aim to incorporate are:
pouchdb-find
relational-pouch
To begin, importing PouchDB looks like this:
import PouchDB from 'pouchdb';
I understand how to import the pouchdb-find plugin and add it to PouchDB:
import PouchDBFind from 'pouchdb-find';
PouchDB.plugin(PouchDBFind);
The next step is adding the relational-pouch plugin:
import PouchDBRelational from 'relational-pouch';
PouchDB.plugin(PouchDBRelational);
Although Typescript compiles without any issues, errors arise in the browser:
index-browser.es.js:2780 Uncaught Error: Invalid plugin: got "undefined", expected an object or a function
...
An alternative approach attempted was:
import PouchDB from 'pouchdb';
import PouchDBFind from 'pouchdb-find';
import PouchDBRelational from 'relational-pouch';
PouchDB.plugin(PouchDBFind , PouchDBRelational);
With no browser errors, a missing method 'setSchema()' from the relational-pouch led me to believe the plugin wasn't loaded correctly.