Closed jusmar3105 closed 2 years ago
Howdy! That code should work with crypto-pouch 4.0.0. Previously, db.crypto()
was not asynchronous, which is why it didn't have a .then()
method -- it wasn't a promise!
Let me know if you're still having issues :)
@Jusmaar there's a type definition now.
$ npm install --save-dev @types/crypto-pouch
import PouchDB from 'pouchdb'; import PouchdbFind from 'pouchdb-find'; import CryptoPouch from 'crypto-pouch'; PouchDB.plugin(PouchdbFind); PouchDB.plugin(CryptoPouch); let db: any = new PouchDB('datalayer'); db.crypto('password').then((res: any) => { console.log(res); });
this doesn't work for me :/
in the browser I have the following error Uncaught TypeError: Cannot read property 'then' of undefined