nieyao

Results 4 comments of nieyao

![image](https://user-images.githubusercontent.com/37135010/101982265-944cc500-3cad-11eb-8aa4-370dc0596fd5.png) 这里岂不是违反了hooks的规则,在条件语句中使用了hooks,导致hooks的顺序错乱?

![image](https://user-images.githubusercontent.com/37135010/102967447-eb179180-452c-11eb-9b0f-26ce0d06c86f.png) 在条件语句中使用可能会使hooks的调用顺序发生改变

const compose = (...fns) => (...params) => fns.reduce((prev, current) => current(prev), ...params);

> @nieyao params 应该置后,测试示例时没有通过 确实,忘了compose是从右往左执行的,那加个reverse 好了。 const compose = (...fns) => (...params) => fns.reverse().reduce((prev, current) => current(prev), ...params) 或者用reduceRight const compose = (...fns) => (...params) => fns.reduceRight((prev, current) => current(prev),...