Skip to content

Commit c9364a9

Browse files
committed
Remove round brackets in single-argumant lambdas
1 parent 7c48cbe commit c9364a9

File tree

7 files changed

+12
-12
lines changed

7 files changed

+12
-12
lines changed

JavaScript/1-wrap.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
const wrap = (fn) => {
3+
const wrap = fn => {
44
console.log('Wrap function: ' + fn.name);
55
return (...args) => {
66
console.log('Called wrapper for: ' + fn.name);

JavaScript/5-timeout.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const timeout = (msec, fn) => {
1818

1919
// Usage
2020

21-
const fn = (par) => {
21+
const fn = par => {
2222
console.log('Function called, par: ' + par);
2323
};
2424

JavaScript/7-once.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const once = fn => (...args) => {
1111

1212
// Usage
1313

14-
const fn = (par) => {
14+
const fn = par => {
1515
console.log('Function called, par: ' + par);
1616
};
1717

JavaScript/8-limit.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const limit = (count, fn) => {
1313

1414
// Usage
1515

16-
const fn = (par) => {
16+
const fn = par => {
1717
console.log('Function called, par: ' + par);
1818
};
1919

JavaScript/9-cancelable.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
const cancelable = (fn) => {
3+
const cancelable = fn => {
44
const wrapper = (...args) => {
55
if (fn) return fn(...args);
66
};
@@ -10,7 +10,7 @@ const cancelable = (fn) => {
1010

1111
// Usage
1212

13-
const fn = (par) => {
13+
const fn = par => {
1414
console.log('Function called, par: ' + par);
1515
};
1616

JavaScript/a-wrap.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
const wrap = (fn) => {
3+
const wrap = fn => {
44
let limit = 0;
55
let counter = 0;
66

@@ -18,14 +18,14 @@ const wrap = (fn) => {
1818
return wrapper;
1919
};
2020

21-
wrapper.timeout = (msec) => {
21+
wrapper.timeout = msec => {
2222
setTimeout(() => {
2323
wrapper.cancel();
2424
}, msec);
2525
return wrapper;
2626
};
2727

28-
wrapper.limit = (count) => {
28+
wrapper.limit = count => {
2929
limit = count;
3030
return wrapper;
3131
};
@@ -35,7 +35,7 @@ const wrap = (fn) => {
3535

3636
// Usage
3737

38-
const fn = (par) => {
38+
const fn = par => {
3939
console.log('Function called, par: ' + par);
4040
};
4141

JavaScript/b-optimzed.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
const wrap = (func) => {
3+
const wrap = func => {
44
let limit = 0;
55
let counter = 0;
66
let timer = null;
@@ -46,7 +46,7 @@ const wrap = (func) => {
4646

4747
// Usage
4848

49-
const fn = (par) => {
49+
const fn = par => {
5050
console.log('Function called, par: ' + par);
5151
};
5252

0 commit comments

Comments
 (0)