Last active
January 16, 2019 14:31
-
-
Save ms314006/6c20969a73ea23af0674a7a1df47b075 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
const newPromise = new Promise((resolve, reject)=>{ | |
/**成功時回傳**/ | |
resolve(status) | |
/**失敗時回傳**/ | |
reject(status) | |
}).then((data)=>{ | |
/**以 then 接續成功時的處理**/ | |
}).catch((error)=>{ | |
/**以 catch 接續失敗時的處理**/ | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment