Become a member
Sign in
Zac Chou
Zac Chou

Zac Chou

18 Following
17 Followers
  • Profile
  • Claps
  • Highlights

Latest

Zac Chou
Zac Chou
Mar 2, 2017 · 1 min read

Mobile web auto open app

IOS 額外能透過Universal Links設置匹配條件,在主機根目錄放置apple-app-site-association檔案,這能夠透過簡訊,或著APP瀏覽器中點擊連結直接打開APP。

apple-app-site-association

{
"applinks": {
"apps": [],
"details": [
{…
Zac Chou
Zac Chou
Feb 15, 2017 · 1 min read

Koa 2 Promise All (ES7 Async Await)

Promise Async Function

// await 回传必须是一个aysnc function 且返回必须是promise.
async function sleep(key, delay) {
return new Promise(function (resolve, reject) {
try {
setTimeout(function () {
resolve({
key: key…

5

Zac Chou
Zac Chou
Feb 14, 2017 · 1 min read

Js 同步的演化

使用 Callback

傳統寫法容易造成Callback Hell 一層一層的寫代碼變得無法維護

function sleepCallback(key, delay, callback) {
setTimeout(function () {
return callback({
key: key,
delay: delay
});
}, delay);
}
var list = []…