Comments (2)
React怎么用的两个例子我都有疑问:
1、将组件state中的数据转为immutabledata有啥好处,我们现在不转也运行的很好,什么场景下才需要用到?
2、第二个,即使info没有使用immutable,只改变了age,pureComponent也是比较的出来的啊,child不会重新渲染,因为此时info传下去的值是一样的
from blog.
@hhhuangqiong 关于immutable的优势和实现原理 可以看下这个 https://www.youtube.com/watch?v=Wo0qiGPSV-s&t=4s 、通俗来讲就是在修改复杂数据类型的时候会返回一个新的对象而不是直接在原本的对象上修改 避免造成数据混乱
这里有一个用immutable实现的五子棋 https://github.com/Jemair/fiveGo immutable的优势在todo 和 redo 里体现的很充分
from blog.
Related Issues (18)
- redux源码解读------createStore.js
- 多人协同编辑的实现 HOT 2
- LanguageServerProtocol
- 面向 Web 端的通用 LanguageServer 实现 HOT 5
- VSCODE 调试器实现原理及实现在线编辑器的调试功能
- VS Code 插件运行机制
- VS Code Workbench 源码解析
- LSIF TypeScript Chrome 插件
- LSIF 插件的一点心得
- 关于LSP相关问题
- redux源码解读------combineReducers.js
- redux源码解读------applyMiddleware.js
- 用于创建高阶组件的React辅助库---recompose
- React技术栈不完全总结
- 面试题整理
- 数据结构之-链表
- 数据结构之-二叉树 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from blog.