TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: React-Most – Declarative Monadic Reactive State Container for React

47 pointsby oyangluluover 8 years ago

7 comments

mhinkover 8 years ago
First and foremost, I applaud the effort to encourage FRP in React applications, especially in the form of an actual library which treats it as a first-class citizen. I think this library is a step in the right direction for state management in Javascript. However, I <i>do</i> have a few thoughts.<p>When I first looked at this, I couldn&#x27;t tell very clearly what advantages this library has over existing approaches to sequenced Redux actions, such as redux-loop or redux-saga, but I think I&#x27;ve got it now. The problem was that I&#x27;ve always thought of Redux actions as a &quot;stream&quot;, so I wasn&#x27;t clear on how this library was different.<p>It looks like you still have stores, but they&#x27;re completely hidden in the HOC created when you `connect()` a React component to a stream (or a composition of streams) of intents.<p>I think this approach is interesting, and I really like the fact that the FRP mindset is &quot;baked into&quot; the library like that, but I don&#x27;t think it makes a strong enough case for me, personally, to abandon the single-store approach.<p>On the other hand, I <i>do</i> believe that it sheds light on a Redux anti-pattern I&#x27;ve seen emerging: namely, the use of complex selectors which &quot;reach into&quot; the Redux store to pull out data in the appropriate shape required by a React component. In other words, Redux becomes a database, and selectors become queries.<p>The alternative (and better) approach, in my opinion, is very similar to how this library works. Where possible, create focused, denormalized reducers which store data in the closest possible representation to how it&#x27;s intended to be consumed. By doing this, you can nearly eliminate the need for libraries like `reselect`.<p>At any rate, I&#x27;m rambling. In the end, I think the concept behind react-most is great, but I think its benefits are equally attainable in Redux, given good consideration and design.
griffinmichlover 8 years ago
Really awesome little library. Nice work. I&#x27;m always excited to see different approaches for making react &#x27;reactive&#x27;.
dawidloubserover 8 years ago
It&#x27;s been interesting to watch so many ECMAScript &#x2F; React libraries inch towards a Functional-reactive &#x2F; streams-based paradigm. I can&#x27;t wait to see which one becomes the de-facto standard, like how Redux is currently the de-facto implementation of the &quot;flux&quot; pattern in React applications.<p>Of course, <a href="https:&#x2F;&#x2F;cycle.js.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;cycle.js.org&#x2F;</a> is one of the original attempts at a pure and simple implementation, and if you haven&#x27;t studied it yet, it&#x27;s wonderfully enriching to understand and play with - even if you don&#x27;t end up using it in a project. (you may use Cycle.js with React, but it is agnostic of UI library)<p>As a software engineer in the third world, doing work mostly in the corporate space, I observe a near un-crossable chasm between the mindset required to understand and use Functional &#x2F; Functional-Reactive platforms, and the mindset of your typical developer - doing .NET, Java EE or Spring. I fear it may be some time before we see adoption of libraries like these in the mainstream &quot;day job&quot; software world.<p>I don&#x27;t mean to say that FRP is always &quot;better&quot; - but rather that it is beyond the comfort zone of typical corporate devs, despite the simplification its adoption may entail. Don&#x27;t know if engineers outside of South Africa encounter the same problem?
评论 #13130058 未加载
ctvoover 8 years ago
Any advantage to just using Redux Observable and Rx (<a href="https:&#x2F;&#x2F;redux-observable.js.org" rel="nofollow">https:&#x2F;&#x2F;redux-observable.js.org</a>)?
imjaredover 8 years ago
Looks neat and absolutely love the diagrams. Thanks for your work.
joshwaover 8 years ago
Buzzword bingo!
polskibusover 8 years ago
Can anyone explain what value does &#x27;monadic&#x27; give to react?
评论 #13125229 未加载
评论 #13129630 未加载