Created
June 7, 2022 23:44
-
-
Save jfoshee/7cf10ab16d519f33c1911dedc5496de4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function toPromise(dbRequest: IDBRequest<any>): Promise<any> { | |
return new Promise((resolve, reject) => { | |
dbRequest.onsuccess = () => resolve(dbRequest.result); | |
dbRequest.onerror = () => reject(); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment