d*******r 发帖数: 3299 | 1 作者:Jim Liu
链接:https://www.zhihu.com/question/63726609/answer/212357616
来源:知乎
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。
Redux是基于纯函数的,为了保证它的“纯度”,它的reducer函数必须是严格的 S' =
f(S) 的形态,所以,与其说Redux是“状态管理”库,不如说它是“状态转移管理”库
,因为Redux是无状态的,状态是在你的程序里的,你自己维持状态,它只是给你提供
了一个状态转移的统一方式。这使得它的整个模型看起来是非常干净。
而事实上我们在开发实际项目当中可能有小半(maybe大半)的reducer场景其实应该是
S' = await fAsync(S) 的形态,比方说,我点了一个计数器+1的按钮,在一个美丽的
DEMO里,它就+1了,但放到生产需求里,很可能是要先发起一个Ajax请求,请求OK了再
+1,甚至这时候不是+1,而是直接和服务端同步一个新的值。
但异步的reducer就破坏了它的“纯度”,因为异步是不确定的,先发不一定先至,这
会破坏reducer的“... 阅读全帖 |
|
w********m 发帖数: 1137 | 2 前端变的快。去年redux还是当红明星。
今年,Dan加入facebook,redux就成了legacy。
redux引入一堆概念,一堆依赖,去实现react本身就有的功能。
只能说明搞前端的精力实在太旺盛了。 |
|
r*****g 发帖数: 9999 | 3 有些基本的数据,比如用户状态信息,不用redux的话,也得放在root component
state里,因为你不知道什么地方会用到或更新这些信息,这样的话跟global state也
没啥区别,child component想读取或则更新的话,要么通过child context,要么得一
层一层的把props传下去,比redux更繁琐。redux的确容易被abuse,但很多时候比不用
方便的多。虽然引入一堆reducer, action creator,但pattern很固定,熟悉了也很简
单。 |
|
d******e 发帖数: 2265 | 4 React+Redux非常精炼,良好运用将发挥出极强劲的生产力。但最大的挑战来自于函数
式编程(FP)范式。在工程化过程中,架构(顶层)设计将是一个巨大的挑战。要不然
做出来的东西可能是一团乱麻。说到底,传统框架与react+redux就是OO与FP编程范式
的对决。
http://www.jianshu.com/p/0e42799be566
赶脚facebook和google两家人员还是有代狗的。
fb更加紧跟形势。狗家还是很传统,guava, angular,其实都是搞java oop的套路。f家
就更加fp话一点了。 |
|
r*****g 发帖数: 9999 | 5 我现在就用redux,不用redux的话用什么来管理global state? |
|
w********m 发帖数: 1137 | 6 instance的变量有各种级别的scope。就算是public的,也有setter和getter。
redux什么东西都在一个global的array里。
每次动一下,都要这个array做copy on write。复杂度把做后端的会气死。
还会误用。redux怎么办了?
就是写多大写加下划线的constant,对应很多接受这些constant的action。
所以写的很累,你要记住这些玩意。 |
|
发帖数: 1 | 7 其实redux的好处还是比较复杂的单app多component频繁切换的场景,mvc里面数据模型
独立性比较好。如果是简单app或是复杂多app切换场景,redux route绑定起来就复杂
了。。。 |
|
l****z 发帖数: 29846 | 8 Obama SOTU 2010 redux: “Cutting the deficit by gutting our investments in
innovation and education is like lightening an overloaded airplane by
removing its engine. It may feel like you're flying high at first, but it
won't take long before you'll feel the impact.” Ignores entitlements that
are majority of budget and all of the deficit
Obama doesn’t want to cut overspending by the government. He barely paid
cutting spending lip service at his SOTU address. Instead, he focused more
on new spendin... 阅读全帖 |
|
i*****s 发帖数: 4596 | 9 Gone to Texas redux — immigration an old story here
Sarah Zenaida Gould, For the Express-News : July 14, 2013 : Updated: July 14
, 2013 12:00am
The story of Texas is a story of migration. In telling this story, a few key
factors emerge.
First, whether you trace your ancestors back to the Lipan Apache, Spanish
explorers or Stephen F. Austin's Old Three Hundred, when you search back far
enough you find that we are all the descendants of people from somewhere
other than the area now known as Texas.... 阅读全帖 |
|
R****e 发帖数: 878 | 10 最近不少Director's Cut/Redux电影上映,ET, Amadeus, 加上先前的Apocalypse Now,
即将上映的Cinema Paradiso,估计DVD不远了。 |
|
发帖数: 1 | 11 从backbone jquery转过来,觉得react+redux好别扭,有人有同感么? |
|
C********g 发帖数: 1548 | 12 I used it for a handful of small web applications. React/Redux is not a good
choice for small enterprise applications, as I can tell. |
|
p*****2 发帖数: 21240 | 13
我觉得react不错,redux开发小应用大幅降低开发效率 |
|
l**********n 发帖数: 8443 | 14 是有些别扭。
不直接。
学redux最好就是直接上手搞它。
因为它要求你事先把component的状态定义好,然后通过props传入数据和函数。 |
|
e*******s 发帖数: 1979 | 15 不别扭 其实挺好的设计 其实就是把mvc的m分了两层 一层丢到前端去了
前端的model对应render view的状态 更新react或者redux的state的时候有算法自动
update view render. |
|
w********m 发帖数: 1137 | 16 Dan自己都说,不要用redux了。
react自带状态机。 |
|
c*********e 发帖数: 16335 | 17 做大项目,還是用redux好。小项目,就不用了。 |
|
p*****2 发帖数: 21240 | 18
我们这里什么都往redux上靠,结果丧失了很多flexibility。想多做点事情就麻烦死了
。 |
|
c*********e 发帖数: 16335 | 19 redux我也不喜欢,很绕。没办法,现在流行啊。 |
|
d*******r 发帖数: 3299 | 20 那redux就成了legacy以后, react 的趋势是啥? |
|
w********m 发帖数: 1137 | 21 为什么要用global state?
除了引入一堆乱七八糟的小部件,reducer,constant外,有什么优点吗?
后端的基本原则是避免global的东西。
child component可以通过函数改变parent component的state。
而且facebook的文档里从来没提过redux,以后维护也是一个难题。 |
|
w********m 发帖数: 1137 | 22 react的核心思想是one way data binding,数据从上面留下来,从而保证安全和高速。
redux就是一个global的array。把所有数据和方法暴露在global,其实是two way data
binding,不是react的风格, |
|
|
h***n 发帖数: 1600 | 24 问一下,你们觉得react/redux test framework是用jest好还是mocha好? |
|
s*********r 发帖数: 3934 | 25 我在用reselect+redux,超级好用啊 |
|
d******c 发帖数: 2407 | 26 纯函数有很多好处,但是现实世界里需要side effect,需要不纯才能做事情。
不应该追求纯,而是能纯函数的地方尽量纯函数,把side effect限制在一定范围内。
Haskell就是太追求纯,我看clojure没这个问题。
redux可能受elm启发,这方面elm也许做的更好一点,不过我不了解细节。 |
|
l**********n 发帖数: 8443 | 27 redux不算啥,整个react生态圈很分割。不像angular那么统一。 |
|
G**U 发帖数: 180 | 28 用了一段时间的redux,现在转vue了。
lz可以看看vue |
|
c****t 发帖数: 19049 | 29 THE GHASTLY ORDEAL OF TIMOTHY CAVENDISH
One bright dusk, four, five, no, my God, six summers ago, I strolled along a
Greenwich
avenue of mature chestnuts and mock oranges in a state of grace. Those
Regency residences
number among London’s costliest properties, but should you ever inherit one
, dear Reader, sell
it, don’t live in it. Houses like these secrete some dark sorcery that
transforms their owners into
fruitcakes. One such victim, an ex-chief of Rhodesian police, had, on the
evening in qu... 阅读全帖 |
|
u***r 发帖数: 4825 | 30 https://time.com/5770140/millennials-change-american-politics/?utm_source=
facebook.com&utm_medium=social&utm_campaign=social-share-article&utm_content
=20200127&fbclid=IwAR36be58A6V9VvNGfu55yIWFvzqs8zNMpZsfrol02sAtggNde_
tGjMlveqI
How Millennial Leaders Will Change America
BY CHARLOTTE ALTER JANUARY 23, 2020
Love ’em or hate ’em, this much is true: one day soon, millennials will
rule America.
This is neither wish nor warning but fact, rooted in the physics of time and
the biology of human cells... 阅读全帖 |
|
l*****n 发帖数: 239 | 31 时间: 本周六东部时间3:00 - 8:00
如果成绩好就可以申请quora的工作. 感兴趣的音童鞋们不要错过啊!
详情见下:
Codesprint Quora
Saturday March 3rd, 3-8pm PST (6-11pm EST)
Announcing Codesprint Quora, the first-ever company sprint.
Sign up here now: https://quora.interviewstreet.com/challenges/
At Quora, we work together as a team to solve some really difficult
engineering problems. We are a technology company, and our aim is to connect
you to everything you want to know about. We are looking for strong
engineers and product engineers to hel... 阅读全帖 |
|
l*****n 发帖数: 239 | 32 时间: 本周六东部时间3:00 - 8:00
如果成绩好就可以申请quora的工作. 感兴趣的音童鞋们不要错过啊!
详情见下:
Codesprint Quora
Saturday March 3rd, 3-8pm PST (6-11pm EST)
Announcing Codesprint Quora, the first-ever company sprint.
Sign up here now: https://quora.interviewstreet.com/challenges/
At Quora, we work together as a team to solve some really difficult
engineering problems. We are a technology company, and our aim is to connect
you to everything you want to know about. We are looking for strong
engineers and product engineers to hel... 阅读全帖 |
|
mn 发帖数: 46 | 33 终于下定决心上 react js,可纠结于 redux 还是 mobx. 他们说大型互联网应用还是
redux 好.
问题是,怎么样衡量一个互联网应用的"型"? 用户请求吞吐量? biz logic 复杂度?
component 之间通信程度?component 数量?
或者如标题所示: stack overflow 算大型 web app 么? mobx 能搞定么?
没有任何前端经验,叩请指正.谢先... |
|
发帖数: 1 | 34 能说说为什么吗? 感觉redux 挺好的,状态只能读,要写状态必须dispatch action.
调理很清晰
: react用用就行了
: 那个redux就是装逼用的
|
|
发帖数: 1 | 35 是吗 redux 的作者现在在脸。但是如果不用redux 两个component 之间要share state
似乎不是很容易
: 在脸自己都没几个人用。
: 何况写个ui,赶快写完就得了,也没指望code用十年得。谁有耐心去读,改?有
那时间
: project早做完了
|
|
k**n 发帖数: 3989 | 36 我工作中也在用 react+redux+TypeScript +mocha+karma+webpack,
初期很难,上手后就好多了。
其实redux很简单,就前期搭框架时是要花点功夫。 后面基本就不会大动了。
另外要习惯ajax call都在 middleware 做然后传actionItem给reducer。。
注意在middleware ajax后改的state都会被丢弃。
用typeScript +tdd的确节约了我不少debug时间。。
我初学时在做了个demo,在github上,有空整理下给大家参考。 |
|
f**d 发帖数: 768 | 37 这是一本计算神经科学的优秀著作,全文拷贝这里(图和公式缺),有兴趣的同学可以
阅读
如需要,我可以分享PDF文件(--仅供个人学习,无商业用途)
From Computer to Brain
William W. Lytton
From Computer to Brain
Foundations of Computational Neuroscience
Springer
William W. Lytton, M.D.
Associate Professor, State University of New York, Downstato, Brooklyn, NY
Visiting Associate Professor, University of Wisconsin, Madison
Visiting Associate Professor, Polytechnic University, Brooklyn, NY
Staff Neurologist., Kings County Hospital, Brooklyn, NY
In From Computer to Brain: ... 阅读全帖 |
|
w*******y 发帖数: 60932 | 38 Namco Games (on sale until 1 December)
99c
Avatwee
BIT.TRIP BEAT
BIT.TRIP BEAT HD
Dug Dug Remix
Galaga Remix
Garters & Ghouls
Gator Panic
Inspector Gadget
Isaac Newton's Gravity
Lt. Fly Rise of the Arachnids
Mr. Driller
Ms. PAC-MAN
Noby Noby Boy
PAC-Attack
PAC-Chain
PAC-Chain Compact
PAC-MAN
PAC-MAN for iPad
PAC-MAN Championship Edition
PAC-Match Party
PAC-Match Party HD
PAC-MAN Remix
Pole Position: Remix
Pool Pro Online 3
Pool Pro Online 3 for iPad
Star Trigon
Tamagotchi: Round the World
Time C... 阅读全帖 |
|
|
u****n 发帖数: 7521 | 40 http://www.nytimes.com/2011/01/03/world/asia/03china.html?partner=rssnyt&emc=rss
China Quietly Extends Footprints Deep Into Central Asia
The New York Time explores China’s expanding influence in the former Soviet
nations of Central Asia:
Chinese officials see Central Asia as a critical frontier for their
nation’s energy security, trade expansion, ethnic stability and military
defense. State enterprises have reached deep into the region with energy
pipelines, railroads and highways, while th... 阅读全帖 |
|
d*********o 发帖数: 6388 | 41 http://wallstreetcn.com/node/97487
(以上为起诉的前高盛女员工Shana Orlich(左)与H. Cristina Chen-Oster(右)摄
于纽约市的照片。由《纽约时报》通过Redux网站获得。)
两名前高盛女员工近日称,找到起诉高盛性别歧视的新证据,计划发起集体诉讼。据她
们的上诉文件所说,高盛的工作环境广泛存在性别歧视,充斥“男生俱乐部”(boy’s
club)的氛围。如时不时会有豪饮,甚至去脱衣舞俱乐部寻欢作乐。
两位女士H. Cristina Chen-Oster与Shanna Orlich早在2010年就提起诉讼,当时她们
要求高盛纠正歧视倾向,未明确具体赔偿。这次两人希望扩大原告主体范围,请求曼哈
顿联邦女法官Analisa Torres允许她们代表现任和前高盛助理与副总起诉,案件将涉及
十多年来对高盛的性别歧视指控。
在递交法院的文件中,两人诉称,指控得到了前高盛员工声明、专家统计数据分析、高
盛自己的盈利与升职记录支持。文件写道:
“女员工报告称公司存在‘男生俱乐部’的氛围,酗酒狂饮是常事。女员工要么因
为性别被区别对待... 阅读全帖 |
|
发帖数: 1 | 42 About
I'm a software engineer with a background in journalism. I have experience
building dynamic web applications in Ruby on Rails, React/Redux, JavaScript,
and HTML/CSS. I've used technologies such as Google Maps API, Amazon Web
Services, and Web Audio API in my projects.
I like making beautiful things and channeling my passions through my work.
From sleek single-page apps that empower solo travelers to explore the world
to highly addictive games that let music lovers jam along to their favori... 阅读全帖 |
|
l****z 发帖数: 29846 | 43 By Marc Tracy
Physicists and others seeking to unlock the mysteries of the universe posit
many theories about what exists beyond our night sky. One of the more
intriguing theories is that our universe is just one of many universes, or
dimensions, in which our doppelganger encounters different experiences and
thus, different outcomes. Given the bizarre rhetoric being used by
Congresswoman Debbie Wasserman Schultz, Chairman of the Democratic National
Committee, and President Obama lately, this t... 阅读全帖 |
|
l****z 发帖数: 29846 | 44 By Roger D. Luchs
A quotation in the September 19, 1926 edition of the Chicago Tribune
included the following observation on the electorate of the day:
No one in this world, so far as I know - and I have searched the records for
years, and employed agents to help me - has ever lost money by
underestimating the intelligence of the great masses of the plain people.
Nor has anyone ever lost public office thereby.
Its author was H.L. Mencken, a noted journalist. Could it be that President
Obama, a... 阅读全帖 |
|
l****z 发帖数: 29846 | 45 1927 Redux——-The Fed Repeats Its Greatest Historical Mistake
by Martin Armstrong • September 18, 2015
by Martin Armstrong
The Federal Reserve yielded to international pressure, making the very same
mistake that it made during 1927. Back then, there was a secret meeting and
the Fed agreed to lower U.S. rates to try to help Europe to deflect capital
inflows back to Europe. The exact opposite unfolded in the aftermath when
even more money abandoned Europe and flowed directly into the U.S. ... 阅读全帖 |
|
g********2 发帖数: 6571 | 46 BYRON YORK ON DONALD TRUMP AND KHIZR KHAN: Cindy Sheehan Redux?
With a few obvious differences, the uproar bears some resemblance to a white
-hot controversy more than a decade ago involving Cindy Sheehan, a
California woman whose son Casey was killed in 2004 while serving in the U.S
. Army in Iraq.
Sheehan became a media sensation when she attacked President George W. Bush
over the war. Opponents of the war immediately took up her cause in their
protests, and Sheehan became, for a while, ubiqui... 阅读全帖 |
|
|
发帖数: 1 | 48 餐饮软件开发商Menusifu诚招前端、后端研发工程师
Menusifu 公司简介:
Menusifu Inc. 是一家总部位于纽约,提供全面餐饮电脑系统软件的创业公司。我们提
供的全新餐饮业点餐系统Menusifu POS整合了iPad,iPad mini与iPhone点餐系统。公
司团队年轻活力有朝气,积极进取,所向披靡。潮水退去,没裤衩的自然消失,放心,
Menusifu产品稳稳接地气并有信仰有灵魂。海阔凭鱼跃,天高任鸟飞,公司发展平台广
阔,任你才华施展。如果你也和我们一样有着Stay hungry, Stay foolish 的学习态度
和自己的成长目标,有创业热情,请记住Menusifu,加入我们,Menusifu与你一起踏在
路上,坚定地!
Software engineer, Back-end web application development
Responsibilities
Develop and deploy back-end web/mobile application with a variety of
technologies including but... 阅读全帖 |
|
b**t 发帖数: 129 | 49 Remote, Work from home. Flexible Work Schedule
NYC. Education service.
Provide technical leadership within the development team
Work effectively within a team environment to implement projects in a timely
manner
Expert knowledge of JavaScript, ES6
Skilled with JavaScript frameworks such as React, Express, Node and Redux
etc.
Commanding grasp of HTML, CSS, and related web technologies
You should have a great feel for users experience and an eye for beautiful
designs.
Deep understanding of best pr... 阅读全帖 |
|
发帖数: 1 | 50 各位好,小弟是Northwestern University CS master毕业生,目前在找software
enginner全职。
本科期间做过OpenGL 3D图形生成,MS期间写过WebGL 3D图形,TCP/IP模块,RPC (
golang)。
在湾区小公司实习过半年,主要是做react native & redux 手机前端开发。
熟练C/C++, JS编程,掌握数据结构和算法,熟悉graphic pipeline,网络协议编程 和
JS前端开发。
求内推相关方面的工作,地点倾向于湾区或者西雅图附近,其他地方也可以relocate。
目前已经毕业,一个月内可以开始工作。 |
|