redux的纯函数和高阶函数区别
原创纯函数
- 只要它是相同的输入(参数),它就必须获得相同的输出(返回)
- 参数数据不得重写
- 无网络请求、输入输出设备等副作用。
- 不能调用
Data.now()或者Math.random()例如不纯方法 - redux的
reducer函数必须是纯函数
高阶函数
参数就是函数或者退货是参数的函数- 常见的高阶函数:定时器设置函数、数组
forEach()/map()/filter()/find()/bind(),Promise等
版权声明
所有资源都来源于爬虫采集,如有侵权请联系我们,我们将立即删除
上一篇:react怎么指定ref的三种方式 下一篇:读懂数据vue响应式和双向绑定原理
相关文章
最新文章
- Stabyourself.net Games 37分钟前
- 【IT 早报】2026年11月19日 - 本周要闻与趋势 41分钟前
- 从均匀平铺到自适应路由:RINs 如何让扩散生成提速 10 倍? 1小时前
- Claude Code makes a finished subagent send its report twice (70-second repro) 2小时前
- Becerra faces a $2B budget deficit as potential AI bust looms 2小时前
- Show HN: Agent Hive – cute Grokbot like agentic teams with queen and many bees 2小时前
- Show HN: Lazycow Studio – turns footage you never edited into reels, locally 3小时前
- Experiments in Weight-Space Programming 3小时前
- Lindy Effect 3小时前
- Meet Your Neighbors – A new type of political compass 5小时前
itfan123

