function promisfy(req, callback) {
    return new Promise((resolve, reject) => {

        /** @this {IDBRequest|IDBOpenDBRequest} */
        req.onsuccess = req.oncomplete = function () {
            callback && callback(this.result);
            callback = null;
            resolve(this.result);
        };
        req.onerror = req.onblocked = reject;
        req = null;
    });
}
@param {IDBRequest|IDBOpenDBRequest} req
@param {Function=} callback
@return {!Promise<undefined>}