1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 | export default function createChainedFunction(...funcs) {
|
11 | return funcs.reduce((acc, func) => {
|
12 | if (func == null) {
|
13 | return acc;
|
14 | }
|
15 |
|
16 | if (process.env.NODE_ENV !== 'production') {
|
17 | if (typeof func !== 'function') {
|
18 | console.error('Material-UI: Invalid Argument Type, must only provide functions, undefined, or null.');
|
19 | }
|
20 | }
|
21 |
|
22 | return function chainedFunction(...args) {
|
23 | acc.apply(this, args);
|
24 | func.apply(this, args);
|
25 | };
|
26 | }, () => {});
|
27 | } |
\ | No newline at end of file |