Skip to content

Commit a7159c7

Browse files
committed
fix(#309): Use flatMap if supported by runtime
1 parent ec814e4 commit a7159c7

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/Control/Bind.js

+6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
export const arrayBind = function (arr) {
2+
if (typeof Array.prototype.flatMap === "function") {
3+
return function (f) {
4+
return arr.flatMap(f);
5+
};
6+
}
7+
28
return function (f) {
39
var result = [];
410
for (var i = 0, l = arr.length; i < l; i++) {

0 commit comments

Comments
 (0)