Skip to content

Commit 2ff5eeb

Browse files
authored
Merge pull request #2255 from vsemozhetbyt/patch-11
Fix semicolons in 1.11.6 (Promisification)
2 parents 032e18b + d5a88b6 commit 2ff5eeb

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
@@ -36,11 +36,11 @@ Here it is:
3636
let loadScriptPromise = function(src) {
3737
return new Promise((resolve, reject) => {
3838
loadScript(src, (err, script) => {
39-
if (err) reject(err)
39+
if (err) reject(err);
4040
else resolve(script);
4141
});
42-
})
43-
}
42+
});
43+
};
4444

4545
// usage:
4646
// loadScriptPromise('path/script.js').then(...)
@@ -71,7 +71,7 @@ function promisify(f) {
7171
f.call(this, ...args); // call the original function
7272
});
7373
};
74-
};
74+
}
7575

7676
// usage:
7777
let loadScriptPromise = promisify(loadScript);
@@ -110,11 +110,11 @@ function promisify(f, manyArgs = false) {
110110
f.call(this, ...args);
111111
});
112112
};
113-
};
113+
}
114114

115115
// usage:
116116
f = promisify(f, true);
117-
f(...).then(arrayOfResults => ..., err => ...)
117+
f(...).then(arrayOfResults => ..., err => ...);
118118
```
119119
120120
As you can see it's essentially the same as above, but `resolve` is called with only one or all arguments depending on whether `manyArgs` is truthy.

0 commit comments

Comments
 (0)