pouchdb icon indicating copy to clipboard operation
pouchdb copied to clipboard

PouchDB-find ES6 updates

Open SourceR85 opened this issue 2 years ago • 0 comments

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

  • resolveToCallback which makes an async function accept a callback parameter as last argument (you can see it as a successor to toPromise). I've added a jsdoc comment to improve DX in IDEs/code editors if they utilize typescript LSP's.

SourceR85 avatar Feb 23 '24 15:02 SourceR85