pouchdb
pouchdb copied to clipboard
PouchDB-find ES6 updates
This patch reduces the juggle between async and callback style in pouchdb-find module.
E.g.: createIndex was a wrapped callback-style function, calling a callback-style to local/createIndex, witch was a callbackify-wrapped async function.
On my way I refactored most of the modules code style to es6 and removed these functions from pouchdb-find/utils because they are no longer used:
-
once -
toPromise -
callbackify -
promisedCallback
and added
-
resolveToCallbackwhich makes an async function accept a callback parameter as last argument (you can see it as a successor totoPromise). I've added a jsdoc comment to improve DX in IDEs/code editors if they utilize typescript LSP's.