<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Sameer Srivastava on Medium]]></title>
        <description><![CDATA[Stories by Sameer Srivastava on Medium]]></description>
        <link>https://medium.com/@sameer13?source=rss-9b8a2d7c667f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*3ZHB-JBtGjk_cVSvAyFCWQ.jpeg</url>
            <title>Stories by Sameer Srivastava on Medium</title>
            <link>https://medium.com/@sameer13?source=rss-9b8a2d7c667f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 07:16:42 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sameer13/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Why use Flux Architecture]]></title>
            <link>https://medium.com/@sameer13/why-use-flux-architecture-fa4502c625c?source=rss-9b8a2d7c667f------2</link>
            <guid isPermaLink="false">https://medium.com/p/fa4502c625c</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[flux]]></category>
            <category><![CDATA[redux]]></category>
            <dc:creator><![CDATA[Sameer Srivastava]]></dc:creator>
            <pubDate>Sun, 14 Jan 2018 17:04:44 GMT</pubDate>
            <atom:updated>2018-01-14T17:38:47.832Z</atom:updated>
            <content:encoded><![CDATA[<p>JavaScript is everywhere these days with new frameworks and libraries coming out every month. Over the last couple of years React and Flux have grown immensely in popularity and according to Github trends the popularity continues to grow. Redux and with it’s Flux pattern is a new favorite for frontend projects.</p><p>You come to wonder why suddenly Flux architecture is becoming so important and mainstream. This article is an attempt to shine some light on the topic and hopefully clear some misconceptions.</p><h3><strong>What is Flux architecture?</strong></h3><p>React was developed by the Facebook team and first released in March 2013. React fits in as the view(V) layer in the tradition MVC concept. It is incredibly fast in rendering changes whenever the application state is modified. It achieves this using the “Virtual DOM” concept. You can read more on the Virtual DOM concept <a href="https://hackernoon.com/virtual-dom-in-reactjs-43a3fdb1d130">here</a>.</p><p>React brings with it a new architecture called “<strong>Flux</strong>” that is used to manage the data flow in the application. A lot of newcomers confuse Flux to be a new framework but it simply is <strong>a new architecture that works on the concept of Unidirectional Data Flow</strong>. We will talk more about it later in the article. First lets understand how application state was managed prior to the introduction of Flux.</p><p><strong><em>Bidirectional data flow pattern</em></strong></p><p>Before Flux came along bidirectional data flow was very popular and widely used. AngularJs, a frontend MVC framework was developed by Google and released first in October 2010. It introduced Two-way data binding which followed bidirectional data flow model and it was magical back in the day when it was first released.</p><p>For many years, the MVC pattern has been the most popular choice for application architecture. In MVC pattern, Controller maintains both application state, and also acts as a glue between the model and view. Introduction of two-way data binding allowed automatically updating the view whenever the data model changes, and vice versa. UI elements were now able to directly mutate your model. This data flow pattern becomes increasingly difficult as your project grows and can lead to cascading updates. Also, mutating one model may trigger more updates.<br>As the state can be mutated by from multiple sources, the application state and data flow becomes unpredictable and hunting down bugs becomes difficult. All these issues led to the adoption of Flux and unidirectional data flow.</p><p><strong><em>Unidirectional data flow pattern</em></strong></p><p>In small applications managing the state is uncomplicated but as applications grow managing the application state becomes important and challenging.</p><p>Flux offers a way to simplify application state management using unidirectional data flow. Whenever a user interacts with the UI, it triggers some actions in the application view layer which in turn change the state of the application. The change in application state is propagated back to the view thus completing the cycle. This pattern of data flow is called Unidirectional Data Flow. Unidirectional data flow provides predictable application state by allowing data to flow in only one direction. It also makes it easy to find the source of bugs since data flows in a pipeline. Unlike the bidirectional model the view here does not change the application state directly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/554/1*lbqHivSilWUi2TOHrBIs3w.jpeg" /><figcaption>Data flow in Flux Architecture</figcaption></figure><p>I hope you enjoyed the post, if you liked it hit me up on <a href="https://twitter.com/sameer13">Twitter </a>or <a href="http://sameer13 at (gmail.com)">email </a>me!</p><p><em>Click the “</em><strong><em>Recommend</em></strong><em>” button below if you found value in this post (so I know if I should write more posts like this)</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fa4502c625c" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>