Skip to content

Commit d5a88b6

Browse files
authored
Fix semicolons in 1.11.6 (Promisification)
1 parent f2078b1 commit d5a88b6

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

1-js/11-async/06-promisify/article.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ Let's promisify it. The new `loadScriptPromise(src)` function achieves the same
2727
let loadScriptPromise = function(src) {
2828
return new Promise((resolve, reject) => {
2929
loadScript(src, (err, script) => {
30-
if (err) reject(err)
30+
if (err) reject(err);
3131
else resolve(script);
3232
});
33-
})
34-
}
33+
});
34+
};
3535

3636
// usage:
3737
// loadScriptPromise('path/script.js').then(...)
@@ -62,7 +62,7 @@ function promisify(f) {
6262
f.call(this, ...args); // call the original function
6363
});
6464
};
65-
};
65+
}
6666

6767
// usage:
6868
let loadScriptPromise = promisify(loadScript);
@@ -94,11 +94,11 @@ function promisify(f, manyArgs = false) {
9494
f.call(this, ...args);
9595
});
9696
};
97-
};
97+
}
9898

9999
// usage:
100100
f = promisify(f, true);
101-
f(...).then(arrayOfResults => ..., err => ...)
101+
f(...).then(arrayOfResults => ..., err => ...);
102102
```
103103
104104
For more exotic callback formats, like those without `err` at all: `callback(result)`, we can promisify such functions manually without using the helper.

0 commit comments

Comments
 (0)