Skip to content

Instantly share code, notes, and snippets.

@ms314006
Last active January 16, 2019 14:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ms314006/6c20969a73ea23af0674a7a1df47b075 to your computer and use it in GitHub Desktop.
Save ms314006/6c20969a73ea23af0674a7a1df47b075 to your computer and use it in GitHub Desktop.
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