Last active
May 13, 2020 06:02
-
-
Save xryuseix/49a4f7fad7817e3532c8e596d9f99491 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 storageGet() { | |
| var res; | |
| chrome.storage.local.get(res = callbackFunc(items)); | |
| console.log(res); | |
| return res; | |
| } | |
| function callbackFunc(items) { | |
| console.log(items); | |
| callback(items); | |
| } | |
| const items = storageGet(); |
new Promise((resolve) => chrome.storage.local.get((items) => resolve)); + return new Promise((resolve) => chrome.storage.local.get((items) => resolve(items))); }やったわテヘペロ
できた!!!ありがとう!!
console.log(playlists); はちゃうな〜
これは,どうしたらよかったの??
普通に
function postPlayLists() {
const playlists = storageGet(() => { /* なんかする */});
}やで
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
function storageGet() { - return new Promise((resolve) => chrome.storage.local.get((items) => resolve)); + return new Promise((resolve) => chrome.storage.local.get((items) => resolve(items))); }やったわテヘペロ