由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - react+redux这段评论的蛮好
相关主题
有人用react + redux么现在学front end framework的话哪个最好?
The good thing and bad thing of React快糙猛还是名不虚传的
再说说react & angular 2framework7
做个类似于redfin那样的网站怎么入手?react is total crap
stack overflow 算大型 web app 么?vue可以搞server-side rendering了。。
最近工作和业余编程的一点感想请教一个ASP.net中异步的问题
interviewstreet 明天有个quora专场 感兴趣的童鞋们可以参加试试转 Redux写起来很麻烦... 去你大爷的纯函数
firefox浏览器插件开发,要求实现过滤掉敏感词Do the two statements cost the same amount of time?
相关话题的讨论汇总
话题: nextstate话题: nextprops话题: var话题: react
进入Programming版参与讨论
1 (共1页)
d******e
发帖数: 2265
1
React+Redux非常精炼,良好运用将发挥出极强劲的生产力。但最大的挑战来自于函数
式编程(FP)范式。在工程化过程中,架构(顶层)设计将是一个巨大的挑战。要不然
做出来的东西可能是一团乱麻。说到底,传统框架与react+redux就是OO与FP编程范式
的对决。
http://www.jianshu.com/p/0e42799be566
赶脚facebook和google两家人员还是有代狗的。
fb更加紧跟形势。狗家还是很传统,guava, angular,其实都是搞java oop的套路。f家
就更加fp话一点了。
l**********n
发帖数: 8443
2
React.js pure render performance anti-pattern
https:[email protected]/* *//react-js-pure-render-performance-a
fb88c101332f#.xrfsamba5
l**********n
发帖数: 8443
3
var ReactComponentWithPureRenderMixin = {
shouldComponentUpdate: function(nextProps, nextState) {
return !shallowEqual(this.props, nextProps) ||
!shallowEqual(this.state, nextState);
}
};
l**********n
发帖数: 8443
4
Why do we need pure functions, immutable data and virtual DOM? These are
optimizations and to some extent simplifications, not core to idea.
var root = document.getElementById('ui');
var prevState = state, prevTree = [];
function render(state) {
// Virtual DOM is really just a tree of JavaScript objects or arrays
return [
['span', {id: 'count'}, state.items.length],
['ul', {}, state.items.map(function (item) {
return ['li', {}, item]
})]
]
}
function updateUI() {
var vTree = render(state);
var diff = vDiff(prevTree, vTree); //Just a diff on data structures,
haha :)
vApply(root, diff) // Apply series of patches to real DOM
prevState = deepcopy(state);
prevTree = vTree;
}
1 (共1页)
进入Programming版参与讨论
相关主题
Do the two statements cost the same amount of time?stack overflow 算大型 web app 么?
tail call strange behavior on cl.exe最近工作和业余编程的一点感想
C++ optimization questioninterviewstreet 明天有个quora专场 感兴趣的童鞋们可以参加试试
用C++的写的numerical or optimization solver libraryfirefox浏览器插件开发,要求实现过滤掉敏感词
有人用react + redux么现在学front end framework的话哪个最好?
The good thing and bad thing of React快糙猛还是名不虚传的
再说说react & angular 2framework7
做个类似于redfin那样的网站怎么入手?react is total crap
相关话题的讨论汇总
话题: nextstate话题: nextprops话题: var话题: react