下面是簡單的場景..如何將promise轉換爲節點js中的回調函數?
我想轉換火力文檔中給我的API,這些代碼..
我怎樣才能將其轉換爲回調函數?
var uid = "some-uid";
admin.auth().createCustomToken(uid)
.then(function(customToken) {
// Send token back to client
})
.catch(function(error) {
console.log("Error creating custom token:", error);
});
這裏是文檔的鏈接..
https://firebase.google.com/docs/auth/admin/create-custom-tokens
不要!擁抱承諾! – Bergi
你使用什麼承諾庫? – Bergi