How to understand such a function as a = > b = > c

how to understand the code well in the case of cascading high-order functions with multiple arrow functions in es6

const setTitle = (title) => (WrappedComponent) => {
   return class extends React.Component {
      componentDidMount() {
          document.title = title
      }
      render() {
         return <WrappedComponent {...this.props} />
      }
   }
}

PS asked: I can understand what everyone said, but I have to change it in my head every time. I feel that the readability of the code is not particularly good, or maybe I am too lame. And is it possible to write two layers at most in this way?


is actually the Coreification of ES6, that is, first define a function, and then return a new function to accept the second parameter
:
can be more than two layers.


const setTitle = (title) => (WrappedComponent) => {}
//
const setTitle = function(title){
    return function(WrappedComponent){
       
    }
}

const setTitle = (title) => {
return (WrappedComponent) => {
   return class extends React.Component {
      componentDidMount() {
          document.title = title
      }
      render() {
         return <WrappedComponent {...this.props} />
      }
   }
 }
}

from right to left, which is equivalent to (title) = > {return () = > {}}


http://blog.oneapm.com/apm-te.


const a => b => c => { /* code */ }
// 
const c = (a, b) => { /* code */ }

the first way of writing can be regarded as the second kind of Creed

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1ba10e2-2e8b1.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1ba10e2-2e8b1.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?