{"id":50800,"date":"2016-06-29T08:00:31","date_gmt":"2016-06-29T15:00:31","guid":{"rendered":"https:\/\/redfindevelop.wpengine.com\/blog\/?p=50800"},"modified":"2020-10-05T13:11:57","modified_gmt":"2020-10-05T20:11:57","slug":"building-a-single-page-application-with-react-and-reflux","status":"publish","type":"post","link":"https:\/\/www.redfin.com\/news\/building-a-single-page-application-with-react-and-reflux\/","title":{"rendered":"Building a Single Page Application with React and Reflux"},"content":{"rendered":"<figure id=\"media-50812\" class=\"align-none\"><\/figure>\n<figure id=\"media-51275\" class=\"align-none\"><img fetchpriority=\"high\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/www.redfin.com\/news\/wp-content\/uploads\/2016\/06\/SPA-Blog-Hero-shot-1.png\" alt=\"Berkeley map page\" width=\"1040\" height=\"569\" \/><\/figure>\n<p><span style=\"font-weight: 400;\">As one of the most trafficked pages at Redfin, the <\/span><a href=\"https:\/\/redfin.com\/city\/1590\/CA\/Berkeley\" target=\"_blank\" rel=\"noopener noreferrer\"><span style=\"font-weight: 400;\">map page<\/span><\/a><span style=\"font-weight: 400;\"> has always been a major driving force behind engaging users with the site and helping people find their dream homes. Redfin was the first company to put homes for sale on a map, and we\u2019ve been working on improving that experience ever since.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Previously, our map was built out using JSP with <\/span><a href=\"https:\/\/dojotoolkit.org\/\" target=\"_blank\" rel=\"noopener noreferrer\"><span style=\"font-weight: 400;\">Dojo<\/span><\/a><span style=\"font-weight: 400;\"> on the client side to handle user interactions. For the past year, we have been converting the map to use <\/span><a href=\"https:\/\/facebook.github.io\/react\/\" target=\"_blank\" rel=\"noopener noreferrer\"><span style=\"font-weight: 400;\">React<\/span><\/a><span style=\"font-weight: 400;\"> and <\/span><a href=\"https:\/\/github.com\/reflux\/refluxjs\" target=\"_blank\" rel=\"noopener noreferrer\"><span style=\"font-weight: 400;\">Reflux<\/span><\/a><span style=\"font-weight: 400;\">, which allows us to take advantage of performance benefits through server-side rendering using <\/span><a href=\"https:\/\/github.com\/redfin\/react-server\" target=\"_blank\" rel=\"noopener noreferrer\"><span style=\"font-weight: 400;\">React Server<\/span><\/a><span style=\"font-weight: 400;\">, our open source framework that we recently announced. This post talks about our setup and how we architected the page to build a single page application using the tools mentioned above.<\/span><\/p>\n<h3><b>Thinking About the Map Page in React and Reflux<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">Reflux is an implementation of Flux for unidirectional data flow composed of stores, views, and actions that handles data, displays data, and initiates data fetching respectively. React fits in as the view layer of the model.<\/span><img decoding=\"async\" class=\"alignnone\" src=\"https:\/\/www.redfin.com\/news\/wp-content\/uploads\/2016\/06\/reflux.png\" alt=\"Reflux flow\" width=\"1478\" height=\"761\" \/><span style=\"font-weight: 400;\">Now let\u2019s walk through a typical map experience:<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Some user interaction triggers a search<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">XHR request fires off to the server side to grab data about homes<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">View layer updates with the new data<\/span><\/li>\n<\/ol>\n<p><span style=\"font-weight: 400;\">By applying the Reflux model, we get an action that defines some user interaction, a store that listens to the action and fires off an XHR request, and a React component that renders the data. This setup benefits greatly from Reflux\u2019s unidirectional data flow architecture which makes the code path clean and easy to manage.<\/span><\/p>\n<h3><b>Deep Dive Into Architecture<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">While figuring out the architecture, we encountered several roadblocks:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">We want to have stores that both retain server data, and govern what the React components look like.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">There are many possible user interactions on the map page and we want to unify them into one code path.<\/span><\/li>\n<\/ul>\n<h4><i><span style=\"font-weight: 400;\">Data and View Stores<\/span><\/i><\/h4>\n<p><span style=\"font-weight: 400;\">Stores are responsible for controlling what the view should display. On the map page, that means the stores are responsible for firing XHR requests, and figuring out complex view logic such as talking to <a href=\"https:\/\/developers.google.com\/maps\/documentation\/javascript\/\" target=\"_blank\" rel=\"noopener noreferrer\">Google Maps API<\/a>. We chose to split out the responsibilities of the store into data stores and view stores, which effectively separates server data from view data.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Data stores are surprisingly simple with a fetch method. Given some parameters, it builds out a request URL and handles the data from the server.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">View stores on the other hand will decide how a component is rendered. The stores can contain business logic that controls whether a component should be hidden, or handle communication with Google Maps. In addition, view stores can be set up to have substores which will provide a hierarchical structure that works nicely with the way React components are built out.<\/span><\/p>\n<h4><i><span style=\"font-weight: 400;\">Managing User Interactions<\/span><\/i><\/h4>\n<p><span style=\"font-weight: 400;\">There are so many ways to do a new search on the map! Some examples include typing in a new region on the search box, opening up the filter and adjusting the price, or simply zooming in on the map.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">This is where Reflux actions come into play. Any user interaction in the React component will fire off an action to notify the store that something has changed. However, we don\u2019t want the data stores to <\/span><i><span style=\"font-weight: 400;\">react<\/span><\/i><span style=\"font-weight: 400;\"> (ha!) to all interactions in the view layer. We let the view stores listen to those actions and decide whether we should bubble those to the data stores to fetch new data.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">But in the world where data and view stores are separate entities, how should the stores communicate with each other?<\/span><\/p>\n<h3><b>Tying it All Together: The Dispatcher<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">In the world of React and Flux, the <\/span><a href=\"https:\/\/facebook.github.io\/flux\/docs\/dispatcher.html\" target=\"_blank\" rel=\"noopener noreferrer\"><span style=\"font-weight: 400;\">dispatcher<\/span><\/a><span style=\"font-weight: 400;\"> is a singleton used to \u201cbroadcast payloads to registered callbacks.\u201d It acts as the hub for data flow and bridges the gap between action callbacks and stores by propagating server data. We really like the simplicity of Reflux (over Flux) and the idea of a hub that manages data flow between server data and the view layer, so we decided to implement our own \u201cdispatcher\u201d.<\/span><img decoding=\"async\" class=\"alignnone\" src=\"https:\/\/www.redfin.com\/news\/wp-content\/uploads\/2016\/06\/dispatcher1.png\" alt=\"Dispatcher setup\" width=\"1478\" height=\"683\" \/><span style=\"font-weight: 400;\">In our architecture, the dispatcher is the bridge that connects the data and view stores. It enables two-way communication between the stores and is responsible for two things:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Telling the data store to fetch<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Passing data to the view stores<\/span><\/li>\n<\/ul>\n<p><i><span style=\"font-weight: 400;\">But wait, that doesn\u2019t look unidirectional does it?<\/span><\/i><\/p>\n<p><span style=\"font-weight: 400;\">The double-headed arrows may indicate otherwise, but let\u2019s sketch out a typical interaction of a user doing a search by typing in a city name in the search box\u2026<\/span><img loading=\"lazy\" decoding=\"async\" class=\"alignnone\" src=\"https:\/\/www.redfin.com\/news\/wp-content\/uploads\/2016\/06\/dispatcher2.png\" alt=\"Unidirectional dispatcher flow\" width=\"1478\" height=\"701\" \/><span style=\"font-weight: 400;\">By decoupling fetching and rendering, we have effectively extended the Reflux flow to the dispatcher and the data store. By breaking down complex stores into substores, you can imagine a hierarchical structure of substores that binds to corresponding React components. Let\u2019s take an overall look at the benefits and downsides of this setup.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">The Pros:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Decoupling data: server data is not directly tied to the view data. View stores act as a layer of abstraction to build out the data hierarchy to be consumed by the view.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Managing lower-level actions: views can contain their own actions that their corresponding view stores will manage.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Managing higher-level actions: only major actions from view components funnel through view stores to the dispatcher.<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">The Cons:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Data duplication: server data is used to build a separate set of view data. Although this has negative impacts on performance, we value the flexibility since the same piece of data is consumed by different components that expect different formats.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Single data mutations: our current setup deals very well with full reflows of the page when we trigger a new search. As a result, single data mutations such as favoriting a home are more cumbersome.<\/span><\/li>\n<\/ul>\n<h3><b>Wrapping it Up<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">This article outlined some of the interesting challenges we encountered when overhauling our frontend architecture on the map page. The transition from Dojo to React and Reflux on React Server was great! We really enjoyed the much more unified code paths and data flows from a unidirectional setup along with great performance features from React Server. Having a more structured code path has also made it a lot easier for other teams to add features to our page!<\/span><\/p>\n<p><span style=\"font-weight: 400;\">I\u2019m not saying that everyone should go back and rewrite their pages. But it is an interesting thought experiment to consider how React and Reflux can be applied to complex pages such as our map page.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Please leave comments below if you have any questions or concerns&#8211;I hope this has been helpful!<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Learn how we built our map page with React and Reflux at Redfin!<\/p>\n","protected":false},"author":13517,"featured_media":50812,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[57],"tags":[78],"dashboard":[],"coauthors":[],"class_list":["post-50800","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-company-news","tag-career"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v24.7 (Yoast SEO v27.5) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Building a Single Page Application with React and Reflux<\/title>\n<meta name=\"description\" content=\"Learn how we built our map page - a single page application - with React and Reflux at Redfin!\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.redfin.com\/news\/building-a-single-page-application-with-react-and-reflux\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Building a Single Page Application with React and Reflux\" \/>\n<meta property=\"og:description\" content=\"Learn how we built our map page - a single page application - with React and Reflux at Redfin!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.redfin.com\/news\/building-a-single-page-application-with-react-and-reflux\/\" \/>\n<meta property=\"og:site_name\" content=\"Redfin Real Estate News\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/redfin\" \/>\n<meta property=\"article:published_time\" content=\"2016-06-29T15:00:31+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-10-05T20:11:57+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.redfin.com\/news\/wp-content\/uploads\/2016\/06\/SPA-Blog-Hero-shot.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1040\" \/>\n\t<meta property=\"og:image:height\" content=\"569\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Tony Hung\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@redfin\" \/>\n<meta name=\"twitter:site\" content=\"@redfin\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Tony Hung\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.redfin.com/news\\\/building-a-single-page-application-with-react-and-reflux\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.redfin.com/news\\\/building-a-single-page-application-with-react-and-reflux\\\/\"},\"author\":{\"name\":\"Tony Hung\",\"@id\":\"https:\\\/\\\/www.redfin.com/news\\\/#\\\/schema\\\/person\\\/0ff180600e6925812a8b217e05ad4f0b\"},\"headline\":\"Building a Single Page Application with React and Reflux\",\"datePublished\":\"2016-06-29T15:00:31+00:00\",\"dateModified\":\"2020-10-05T20:11:57+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.redfin.com/news\\\/building-a-single-page-application-with-react-and-reflux\\\/\"},\"wordCount\":1105,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.redfin.com/news\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.redfin.com/news\\\/building-a-single-page-application-with-react-and-reflux\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.redfin.com/news\\\/wp-content\\\/uploads\\\/2016\\\/06\\\/SPA-Blog-Hero-shot.png\",\"keywords\":[\"Career\"],\"articleSection\":[\"Company News\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.redfin.com/news\\\/building-a-single-page-application-with-react-and-reflux\\\/#respond\"]}],\"copyrightYear\":\"2016\",\"copyrightHolder\":{\"@id\":\"https:\\\/\\\/www.redfin.com/news\\\/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.redfin.com/news\\\/building-a-single-page-application-with-react-and-reflux\\\/\",\"url\":\"https:\\\/\\\/www.redfin.com/news\\\/building-a-single-page-application-with-react-and-reflux\\\/\",\"name\":\"Building a Single Page Application with React and Reflux\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.redfin.com/news\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.redfin.com/news\\\/building-a-single-page-application-with-react-and-reflux\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.redfin.com/news\\\/building-a-single-page-application-with-react-and-reflux\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.redfin.com/news\\\/wp-content\\\/uploads\\\/2016\\\/06\\\/SPA-Blog-Hero-shot.png\",\"datePublished\":\"2016-06-29T15:00:31+00:00\",\"dateModified\":\"2020-10-05T20:11:57+00:00\",\"description\":\"Learn how we built our map page - a single page application - with React and Reflux at Redfin!\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.redfin.com/news\\\/building-a-single-page-application-with-react-and-reflux\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.redfin.com/news\\\/building-a-single-page-application-with-react-and-reflux\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.redfin.com/news\\\/building-a-single-page-application-with-react-and-reflux\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.redfin.com/news\\\/wp-content\\\/uploads\\\/2016\\\/06\\\/SPA-Blog-Hero-shot.png\",\"contentUrl\":\"https:\\\/\\\/www.redfin.com/news\\\/wp-content\\\/uploads\\\/2016\\\/06\\\/SPA-Blog-Hero-shot.png\",\"width\":1040,\"height\":569},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.redfin.com/news\\\/building-a-single-page-application-with-react-and-reflux\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.redfin.com/news\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Building a Single Page Application with React and Reflux\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.redfin.com/news\\\/#website\",\"url\":\"https:\\\/\\\/www.redfin.com/news\\\/\",\"name\":\"Redfin Real Estate News\",\"description\":\"The latest real estate news and research from technology-powered residential real estate company, Redfin.\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.redfin.com/news\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.redfin.com/news\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.redfin.com/news\\\/#organization\",\"name\":\"Redfin\",\"url\":\"https:\\\/\\\/www.redfin.com/news\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.redfin.com/news\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.redfin.com\\\/news\\\/wp-content\\\/uploads\\\/2020\\\/10\\\/Redfin-News-Logo.png\",\"contentUrl\":\"https:\\\/\\\/www.redfin.com\\\/news\\\/wp-content\\\/uploads\\\/2020\\\/10\\\/Redfin-News-Logo.png\",\"width\":1100,\"height\":235,\"caption\":\"Redfin\"},\"image\":{\"@id\":\"https:\\\/\\\/www.redfin.com/news\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/redfin\",\"https:\\\/\\\/x.com\\\/redfin\",\"https:\\\/\\\/www.instagram.com\\\/redfinrealestate\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/redfin\",\"https:\\\/\\\/www.pinterest.com\\\/redfin\\\/\",\"https:\\\/\\\/en.wikipedia.org\\\/wiki\\\/Redfin\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.redfin.com/news\\\/#\\\/schema\\\/person\\\/0ff180600e6925812a8b217e05ad4f0b\",\"name\":\"Tony Hung\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/f70fad77b0b807eaaa67d9e9af97283bfa90cb92d869a79d72003d3f8779ecd9?s=96&d=wp_user_avatar&r=g6bf3e07807fe7da60b7e837911380f47\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/f70fad77b0b807eaaa67d9e9af97283bfa90cb92d869a79d72003d3f8779ecd9?s=96&d=wp_user_avatar&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/f70fad77b0b807eaaa67d9e9af97283bfa90cb92d869a79d72003d3f8779ecd9?s=96&d=wp_user_avatar&r=g\",\"caption\":\"Tony Hung\"},\"description\":\"Developer on the search team. Coder by day, gamer and streamer by night.\",\"sameAs\":[\"http:\\\/\\\/www.tonyhyk.com\"],\"url\":\"https:\\\/\\\/www.redfin.com/news\\\/author\\\/tony-hungredfin-com\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Building a Single Page Application with React and Reflux","description":"Learn how we built our map page - a single page application - with React and Reflux at Redfin!","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.redfin.com\/news\/building-a-single-page-application-with-react-and-reflux\/","og_locale":"en_US","og_type":"article","og_title":"Building a Single Page Application with React and Reflux","og_description":"Learn how we built our map page - a single page application - with React and Reflux at Redfin!","og_url":"https:\/\/www.redfin.com\/news\/building-a-single-page-application-with-react-and-reflux\/","og_site_name":"Redfin Real Estate News","article_publisher":"https:\/\/www.facebook.com\/redfin","article_published_time":"2016-06-29T15:00:31+00:00","article_modified_time":"2020-10-05T20:11:57+00:00","og_image":[{"width":1040,"height":569,"url":"https:\/\/www.redfin.com\/news\/wp-content\/uploads\/2016\/06\/SPA-Blog-Hero-shot.png","type":"image\/png"}],"author":"Tony Hung","twitter_card":"summary_large_image","twitter_creator":"@redfin","twitter_site":"@redfin","twitter_misc":{"Written by":"Tony Hung","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.redfin.com\/news\/building-a-single-page-application-with-react-and-reflux\/#article","isPartOf":{"@id":"https:\/\/www.redfin.com\/news\/building-a-single-page-application-with-react-and-reflux\/"},"author":{"name":"Tony Hung","@id":"https:\/\/www.redfin.com\/news\/#\/schema\/person\/0ff180600e6925812a8b217e05ad4f0b"},"headline":"Building a Single Page Application with React and Reflux","datePublished":"2016-06-29T15:00:31+00:00","dateModified":"2020-10-05T20:11:57+00:00","mainEntityOfPage":{"@id":"https:\/\/www.redfin.com\/news\/building-a-single-page-application-with-react-and-reflux\/"},"wordCount":1105,"commentCount":0,"publisher":{"@id":"https:\/\/www.redfin.com\/news\/#organization"},"image":{"@id":"https:\/\/www.redfin.com\/news\/building-a-single-page-application-with-react-and-reflux\/#primaryimage"},"thumbnailUrl":"https:\/\/www.redfin.com\/news\/wp-content\/uploads\/2016\/06\/SPA-Blog-Hero-shot.png","keywords":["Career"],"articleSection":["Company News"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.redfin.com\/news\/building-a-single-page-application-with-react-and-reflux\/#respond"]}],"copyrightYear":"2016","copyrightHolder":{"@id":"https:\/\/www.redfin.com\/news\/#organization"}},{"@type":"WebPage","@id":"https:\/\/www.redfin.com\/news\/building-a-single-page-application-with-react-and-reflux\/","url":"https:\/\/www.redfin.com\/news\/building-a-single-page-application-with-react-and-reflux\/","name":"Building a Single Page Application with React and Reflux","isPartOf":{"@id":"https:\/\/www.redfin.com\/news\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.redfin.com\/news\/building-a-single-page-application-with-react-and-reflux\/#primaryimage"},"image":{"@id":"https:\/\/www.redfin.com\/news\/building-a-single-page-application-with-react-and-reflux\/#primaryimage"},"thumbnailUrl":"https:\/\/www.redfin.com\/news\/wp-content\/uploads\/2016\/06\/SPA-Blog-Hero-shot.png","datePublished":"2016-06-29T15:00:31+00:00","dateModified":"2020-10-05T20:11:57+00:00","description":"Learn how we built our map page - a single page application - with React and Reflux at Redfin!","breadcrumb":{"@id":"https:\/\/www.redfin.com\/news\/building-a-single-page-application-with-react-and-reflux\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.redfin.com\/news\/building-a-single-page-application-with-react-and-reflux\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.redfin.com\/news\/building-a-single-page-application-with-react-and-reflux\/#primaryimage","url":"https:\/\/www.redfin.com\/news\/wp-content\/uploads\/2016\/06\/SPA-Blog-Hero-shot.png","contentUrl":"https:\/\/www.redfin.com\/news\/wp-content\/uploads\/2016\/06\/SPA-Blog-Hero-shot.png","width":1040,"height":569},{"@type":"BreadcrumbList","@id":"https:\/\/www.redfin.com\/news\/building-a-single-page-application-with-react-and-reflux\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.redfin.com\/news\/"},{"@type":"ListItem","position":2,"name":"Building a Single Page Application with React and Reflux"}]},{"@type":"WebSite","@id":"https:\/\/www.redfin.com\/news\/#website","url":"https:\/\/www.redfin.com\/news\/","name":"Redfin Real Estate News","description":"The latest real estate news and research from technology-powered residential real estate company, Redfin.","publisher":{"@id":"https:\/\/www.redfin.com\/news\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.redfin.com\/news\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.redfin.com\/news\/#organization","name":"Redfin","url":"https:\/\/www.redfin.com\/news\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.redfin.com\/news\/#\/schema\/logo\/image\/","url":"https:\/\/www.redfin.com\/news\/wp-content\/uploads\/2020\/10\/Redfin-News-Logo.png","contentUrl":"https:\/\/www.redfin.com\/news\/wp-content\/uploads\/2020\/10\/Redfin-News-Logo.png","width":1100,"height":235,"caption":"Redfin"},"image":{"@id":"https:\/\/www.redfin.com\/news\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/redfin","https:\/\/x.com\/redfin","https:\/\/www.instagram.com\/redfinrealestate\/","https:\/\/www.linkedin.com\/company\/redfin","https:\/\/www.pinterest.com\/redfin\/","https:\/\/en.wikipedia.org\/wiki\/Redfin"]},{"@type":"Person","@id":"https:\/\/www.redfin.com\/news\/#\/schema\/person\/0ff180600e6925812a8b217e05ad4f0b","name":"Tony Hung","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/f70fad77b0b807eaaa67d9e9af97283bfa90cb92d869a79d72003d3f8779ecd9?s=96&d=wp_user_avatar&r=g6bf3e07807fe7da60b7e837911380f47","url":"https:\/\/secure.gravatar.com\/avatar\/f70fad77b0b807eaaa67d9e9af97283bfa90cb92d869a79d72003d3f8779ecd9?s=96&d=wp_user_avatar&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/f70fad77b0b807eaaa67d9e9af97283bfa90cb92d869a79d72003d3f8779ecd9?s=96&d=wp_user_avatar&r=g","caption":"Tony Hung"},"description":"Developer on the search team. Coder by day, gamer and streamer by night.","sameAs":["http:\/\/www.tonyhyk.com"],"url":"https:\/\/www.redfin.com\/news\/author\/tony-hungredfin-com\/"}]}},"_links":{"self":[{"href":"https:\/\/www.redfin.com\/news\/wp-json\/wp\/v2\/posts\/50800","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.redfin.com\/news\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.redfin.com\/news\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.redfin.com\/news\/wp-json\/wp\/v2\/users\/13517"}],"replies":[{"embeddable":true,"href":"https:\/\/www.redfin.com\/news\/wp-json\/wp\/v2\/comments?post=50800"}],"version-history":[{"count":0,"href":"https:\/\/www.redfin.com\/news\/wp-json\/wp\/v2\/posts\/50800\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.redfin.com\/news\/wp-json\/wp\/v2\/media\/50812"}],"wp:attachment":[{"href":"https:\/\/www.redfin.com\/news\/wp-json\/wp\/v2\/media?parent=50800"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.redfin.com\/news\/wp-json\/wp\/v2\/categories?post=50800"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.redfin.com\/news\/wp-json\/wp\/v2\/tags?post=50800"},{"taxonomy":"dashboard","embeddable":true,"href":"https:\/\/www.redfin.com\/news\/wp-json\/wp\/v2\/dashboard?post=50800"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.redfin.com\/news\/wp-json\/wp\/v2\/coauthors?post=50800"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}