{"id":3260,"date":"2022-02-17T12:00:00","date_gmt":"2022-02-17T12:00:00","guid":{"rendered":"http:\/\/the-codest.localhost\/blog\/going-from-redux-to-mobx\/"},"modified":"2026-04-28T14:06:46","modified_gmt":"2026-04-28T14:06:46","slug":"gar-fra-redux-til-mobx","status":"publish","type":"post","link":"https:\/\/thecodest.co\/nb\/blog\/going-from-redux-to-mobx\/","title":{"rendered":"G\u00e5 fra Redux til MobX"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Why are we here?<\/h2>\n\n\n\n<p>Sooner or later, we will move it to the <strong>MobX<\/strong> state, just as we did with the other apps. That is why I decided to have a quick look at it. There will not be that much <a href=\"https:\/\/thecodest.co\/nb\/dictionary\/what-is-code-refactoring\/\">code<\/a> here and I believe you have already heard about <strong>Redux<\/strong>. Let\u2019s start.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What is Redux?<\/h2>\n\n\n\n<p>As stated at <a href=\"https:\/\/redux.js.org\/\" rel=\"nofollow\">redux.js.org<\/a>, it\u2019s \u201ca predictable state of container for <strong><a href=\"https:\/\/thecodest.co\/nb\/blog\/hire-vue-js-developers\/\">JS<\/a> Apps<\/strong>.\u201d It was created by Dan Abramov and Andrew Clark in 2015.<br>It can be described by <a href=\"https:\/\/redux.js.org\/understanding\/thinking-in-redux\/three-principles\" rel=\"nofollow\">3 principles<\/a>:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Single point of truth \u2013 the state is kept in a single store,<\/li>\n\n\n\n<li>State is read-only &#8211; you cannot directly change the state, you should emit an action to do so,<\/li>\n\n\n\n<li>Changes are made with pure functions &#8211; pure functions by definition always return the same results for given parameters, can be executed always, and have no side effects.<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">What is MobX?<\/h2>\n\n\n\n<p>No surprise here, <strong>MobX <\/strong> is also a library for state management, it transparently applies functional reactive programming (TFRP) to make it simple and scalable. Similarly to the preceding library, its philosophy is described in 3 points:<br>1. Straightforward &#8211; minimalistic, boiler-free code and no special tools required to operate it,<br>2. Effortless optimal rendering &#8211; it makes sure all computations are optimized well and there is no need to manually do so,<br>3. Architectural freedom &#8211; implementation is unopinionated and can be used without any UI framework.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">MobX and Redux Comparison<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Learning<\/h3>\n\n\n\n<p><strong><a href=\"https:\/\/thecodest.co\/nb\/blog\/conditional-component-visibility-in-react\/\">React<\/a><\/strong> is known for the serious boilerplate around the initial setup. You cannot neglect it. Especially when you have a bigger application with a lot of reducers and actions, you have probably already decided to keep the action types as constants in the strings, which is a good approach, but then there is even more code! Fortunately, the <a href=\"https:\/\/www.npmjs.com\/package\/@reduxjs\/toolkit\" rel=\"nofollow\">Redux Toolkit<\/a> is getting more popularity and it is now recommended to write <strong>Redux<\/strong> logic. If you ask me, I like it! Still, there is a lot to learn, but the simple basic setup with the Toolkit does the job.<\/p>\n\n\n\n<p>When I looked at the <strong>MobX documentation<\/strong>, I was like a kid who accidentally landed in a chocolate factory. I was going through the examples and I kept asking how that could work, but it does and apparently does it well. But maybe handling all of the reducers, actions, middlewares, and other stuff makes it so easy to get fascinated by something else. Nevertheless, if you are familiar with <a href=\"https:\/\/thecodest.co\/nb\/dictionary\/object-oriented-programming-oop\/\">OOP<\/a>, <strong>MobX<\/strong> will come naturally to you. There is much less initial coding and many things happen behind the scenes, so you do not need to care about them in most cases.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Data structure &#8211; what is inside the state?<\/h3>\n\n\n\n<p>In <strong>Redux<\/strong>, we have to use primitives, arrays, or plain <strong>JS<\/strong> objects as <a href=\"https:\/\/thecodest.co\/nb\/blog\/app-data-collection-security-risks-value-and-types-explored\/\">data<\/a> for our state.<br>Also, there is a common practice when you store data in arrays, namely to normalize it for performance reasons. Unfortunately, even with the helper functions in Redux&#8217;s Toolkit (e.g., <code>createEntityAdapter<\/code>) that still adds additional code.<\/p>\n\n\n\n<p>In <strong>MobX<\/strong>, we make properties, entire objects, arrays, Map and Sets <code>observable.<\/code> Yes, primitives are not mentioned here because their values in <strong>JS<\/strong> are immutable and because of that they need to be treated differently. All you need to know if you go with an <code>observable<\/code> is that it will wrap the primitive in \u201ca box\u201d and the actual value getter and setter will be available via <code>.get()<\/code> and <code>.set(newValue)<\/code> respectively<a href=\"https:\/\/mobx.js.org\/api.html#observablebox) documentation\" rel=\"nofollow\"> see observable.box(value)<\/a><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"javascript\" class=\"language-javascript\">import { observable, autorun } from \"mobx\"\n\nconst cityName = observable.box(\"Vienna\") \/\/ same as observable(\"Vienna\")\n\nautorun(() =&gt; {\n    console.log(cityName.get())\n})\n\/\/ Prints: 'Vienna'\n\ncityName.set(\"Amsterdam\")\n\/\/ Prints: 'Amsterdam'<\/code><\/pre>\n\n\n\n<p>There is no need for normalization of data, as <strong>MobX<\/strong><code> observable<\/code>` clones the object, makes it observable and, therefore, makes sure that all changes are reflected in the store once we update any of the observable properties.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Location of data &#8211; store(s)<\/h3>\n\n\n\n<p>We have a single source of truth in <strong>Redux<\/strong>. By keeping the state in one location, we make sure the data is not duplicated all over the app and it becomes easier to debug.<\/p>\n\n\n\n<p><strong>MobX<\/strong> actually encourages having at least two separate stores, one for the UI state and one or more for the domain state. That separation allows <a href=\"https:\/\/thecodest.co\/nb\/blog\/why-us-companies-are-opting-for-polish-developers\/\">us<\/a> to reuse the domain in different applications.<\/p>\n\n\n\n<p>Because we are not limited to <strong>JS<\/strong> plain objects, it seems natural to create its own classes for particular domain objects, as the authors suggest. Here, <strong>Mobx<\/strong> shines for those of you who like object-oriented programming. You can have methods, control over what should be observable or not. In addition, we can combine multiple stores and share the references.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Immutable &amp; Mutable<\/h3>\n\n\n\n<p><strong>Redux<\/strong> requires that the update of state <em>does not mutate<\/em> the original state. So, if we want to add a new item to an existing array, we need to return a new instance instead of just adding that item to the current one.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"javascript\" class=\"language-javascript\">function todoReducer(state = [], action) {\n    \/\/ here we create a new array and use a spread operator to keep the old values\n    return [\n      ...state,\n     action.payload\n    ]\n}<\/code><\/pre>\n\n\n\n<p>Then, in <strong>MobX<\/strong>, we can mutate the observable properties, here: the <code>todos<\/code> array. Notice we mutate the original array in <code>addTodo<\/code><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"javascript\" class=\"language-javascript\">class ObservableTodoStore {\n  todos = [];\n\n  constructor() {\n    makeObservable(this, {\n      todos: observable,\n      addTodo: action,\n    });\n    autorun(() =&gt; console.log(this.todos.length))\n  }\n\n\n  addTodo(task) {\n    \/\/here we are just pushing the new item to the existing array!\n    this.todos.push({\n      task: task,\n      completed: false,\n    });\n  }\n\n}\n\nconst observableTodoStore = new ObservableTodoStore();\nobservableTodoStore.addTodo(\"Some tough thing to do\");<\/code><\/pre>\n\n\n\n<p>What\u2019s more, we can even directly update the <code>todo<\/code> list and we will see that <code>autorun<\/code> will be fired (it will notice a change in the observable array of <code>todos<\/code>).<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"javascript\" class=\"language-javascript\">observableTodoStore.todos.push(\"Some other tough task\");\n\n\/\/ What is more interesting, only when you update the particular to-do property\n\/\/ will MobX warn you (while in strict mode) that you shouldn\u2019t do that directly\nobservableTodoStore.todos[1].task = (\"Maybe something more effortless\");<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Debugging<\/h3>\n\n\n\n<p>Personally, I really like the Chrome <a href=\"https:\/\/chrome.google.com\/webstore\/detail\/redux-devtools\/lmhkpmbekcpmknklioeibfkpmmfibljd\" rel=\"nofollow\">Redux DevTools extension<\/a>. It allows you to have a quick look at your app\u2019s state and has nice capabilities to go back and forth for every change to the state (time travel!). All that is possible because of the principle that you do not mutate the previous state.<\/p>\n\n\n\n<p>The additional layer of abstraction to the store makes the process of debugging more difficult. The <a href=\"https:\/\/github.com\/mobxjs\/mobx-devtools\" rel=\"nofollow\">MobX Chrome extension<\/a> seems so cumbersome to me, especially if compared to the previous experience, but maybe I need some time to get used to it.<\/p>\n\n\n\n<p>But we have, e.g., the <code>autorun<\/code> track function that you probably will use a lot when starting to use the <strong>MobX<\/strong> and wanting to check when the state changes. You need to note that the function will only track the changes it observes. That is determined once the function runs for the first time. <strong>MobX<\/strong> will subscribe to all observables that were read during that first invocation and then it will be triggered every time they change.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Popularity<\/h3>\n\n\n\n<p>When you look at the popularity, Redux prevails here. Near <a href=\"https:\/\/www.npmjs.com\/package\/redux\" rel=\"nofollow\">4M downloads<\/a> from npm per week compared to <a href=\"https:\/\/www.npmjs.com\/package\/mobx\" rel=\"nofollow\">450k for MobX<\/a>. Also, the number of contributors (~870 &gt; 270) and stars (57k &gt; 24k) on GitHub\u2019s repository for each library shows that Redux is a well-known brand.<\/p>\n\n\n\n<p>On the other hand, <a href=\"https:\/\/2020.stateofjs.com\/en-US\/technologies\/datalayer\/\" rel=\"nofollow\">State of JS 2020 report<\/a> shows the satisfaction from using them at almost the same level, so it definitely won\u2019t help you decide which one to pick for your next <a href=\"https:\/\/thecodest.co\/nb\/dictionary\/why-do-projects-fail\/\">project<\/a>.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"\/app\/uploads\/2024\/05\/CgfmJjf.png\" alt=\"State of JS 2020 data layer libraries satisfaction chart\"\/><\/figure>\n\n\n\n<p>The satisfaction in this chart was described as \u201cwould use again \/ (would use again + would not use again)\u201d<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>There arent winners in this contest\u2026 yet! BTW, there was no contest at all \ud83d\ude09 I believe both libraries are doing a great job with accomplishing their basic task, which is taking care of having a solid management state in your <strong>JS application <\/strong>. I will need more time to see how the daily work with <strong>MobX<\/strong> differs from <strong>Redux<\/strong> and for which cases I could recommend it.<\/p>\n\n\n\n<p>For now, I can say I am already missing the \u201ctime travel\u201d from Redux\u2019s DevTools, but on the other hand setting a state with <strong>MobX <\/strong> seems so straightforward and the written code looks much more readable.<\/p>\n\n\n\n<p>Nevertheless, I am so curious how the <code>observable<\/code> handles the performance, as whenever I see some magic, I wonder how much of the resources of my PC (whether it is CPU time, memory or drive) are used and how efficient it is. That will definitely be my next stage of research.<\/p>\n\n\n\n<p>Hopefully, I will get back to you with some really exciting explanations on how you can solve particular problems with <strong>MobX<\/strong>. See you then!<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/thecodest.co\/contact\/\"><img loading=\"lazy\" decoding=\"async\" width=\"1283\" height=\"460\" src=\"https:\/\/thecodest.co\/app\/uploads\/2024\/05\/interested_in_cooperation_.png\" alt=\"\" class=\"wp-image-4927\" srcset=\"https:\/\/thecodest.co\/app\/uploads\/2024\/05\/interested_in_cooperation_.png 1283w, https:\/\/thecodest.co\/app\/uploads\/2024\/05\/interested_in_cooperation_-300x108.png 300w, https:\/\/thecodest.co\/app\/uploads\/2024\/05\/interested_in_cooperation_-1024x367.png 1024w, https:\/\/thecodest.co\/app\/uploads\/2024\/05\/interested_in_cooperation_-768x275.png 768w, https:\/\/thecodest.co\/app\/uploads\/2024\/05\/interested_in_cooperation_-18x6.png 18w, https:\/\/thecodest.co\/app\/uploads\/2024\/05\/interested_in_cooperation_-67x24.png 67w\" sizes=\"auto, (max-width: 1283px) 100vw, 1283px\" \/><\/a><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Den dagen du trenger \u00e5 bli kjent med en annen teknologi, er faktisk hver dag i en utviklers liv. I dette spesielle scenariet har jeg havnet i et prosjekt som viste seg \u00e5 v\u00e6re det siste i selskapet som bruker Redux til \u00e5 administrere tilstanden i React-appen.<\/p>","protected":false},"author":2,"featured_media":3261,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[8],"tags":[],"class_list":["post-3260","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-software-development"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.3 (Yoast SEO v27.3) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Going from Redux to MobX - The Codest<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/thecodest.co\/nb\/blogg\/gar-fra-redux-til-mobx\/\" \/>\n<meta property=\"og:locale\" content=\"nb_NO\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Going from Redux to MobX\" \/>\n<meta property=\"og:description\" content=\"The day when you need to get familiar with a different technology is actually every day in a developer\u2019s life. In this particular scenario, I\u2019ve landed in a project that turned out to be the last within the company which uses Redux to manage the state in React app.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/thecodest.co\/nb\/blogg\/gar-fra-redux-til-mobx\/\" \/>\n<meta property=\"og:site_name\" content=\"The Codest\" \/>\n<meta property=\"article:published_time\" content=\"2022-02-17T12:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-04-28T14:06:46+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/thecodest.co\/app\/uploads\/2024\/05\/going_from_redux_to_mobx.png\" \/>\n\t<meta property=\"og:image:width\" content=\"960\" \/>\n\t<meta property=\"og:image:height\" content=\"540\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"thecodest\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"thecodest\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutter\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/going-from-redux-to-mobx\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/going-from-redux-to-mobx\\\/\"},\"author\":{\"name\":\"thecodest\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/#\\\/schema\\\/person\\\/7e3fe41dfa4f4e41a7baad4c6e0d4f76\"},\"headline\":\"Going from Redux to MobX\",\"datePublished\":\"2022-02-17T12:00:00+00:00\",\"dateModified\":\"2026-04-28T14:06:46+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/going-from-redux-to-mobx\\\/\"},\"wordCount\":1289,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/going-from-redux-to-mobx\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/thecodest.co\\\/app\\\/uploads\\\/2024\\\/05\\\/going_from_redux_to_mobx.png\",\"articleSection\":[\"Software Development\"],\"inLanguage\":\"nb-NO\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/thecodest.co\\\/blog\\\/going-from-redux-to-mobx\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/going-from-redux-to-mobx\\\/\",\"url\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/going-from-redux-to-mobx\\\/\",\"name\":\"Going from Redux to MobX - The Codest\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/going-from-redux-to-mobx\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/going-from-redux-to-mobx\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/thecodest.co\\\/app\\\/uploads\\\/2024\\\/05\\\/going_from_redux_to_mobx.png\",\"datePublished\":\"2022-02-17T12:00:00+00:00\",\"dateModified\":\"2026-04-28T14:06:46+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/going-from-redux-to-mobx\\\/#breadcrumb\"},\"inLanguage\":\"nb-NO\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/thecodest.co\\\/blog\\\/going-from-redux-to-mobx\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"nb-NO\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/going-from-redux-to-mobx\\\/#primaryimage\",\"url\":\"https:\\\/\\\/thecodest.co\\\/app\\\/uploads\\\/2024\\\/05\\\/going_from_redux_to_mobx.png\",\"contentUrl\":\"https:\\\/\\\/thecodest.co\\\/app\\\/uploads\\\/2024\\\/05\\\/going_from_redux_to_mobx.png\",\"width\":960,\"height\":540},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/going-from-redux-to-mobx\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/thecodest.co\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Going from Redux to MobX\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/#website\",\"url\":\"https:\\\/\\\/thecodest.co\\\/\",\"name\":\"The Codest\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/thecodest.co\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"nb-NO\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/#organization\",\"name\":\"The Codest\",\"url\":\"https:\\\/\\\/thecodest.co\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"nb-NO\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/thecodest.co\\\/app\\\/uploads\\\/2024\\\/03\\\/thecodest-logo.svg\",\"contentUrl\":\"https:\\\/\\\/thecodest.co\\\/app\\\/uploads\\\/2024\\\/03\\\/thecodest-logo.svg\",\"width\":144,\"height\":36,\"caption\":\"The Codest\"},\"image\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/pl.linkedin.com\\\/company\\\/codest\",\"https:\\\/\\\/clutch.co\\\/profile\\\/codest\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/#\\\/schema\\\/person\\\/7e3fe41dfa4f4e41a7baad4c6e0d4f76\",\"name\":\"thecodest\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"nb-NO\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5dbfe6a1e8c86e432e8812759e34e6fe82ebac75119ae3237a6c1311fa19caf4?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5dbfe6a1e8c86e432e8812759e34e6fe82ebac75119ae3237a6c1311fa19caf4?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5dbfe6a1e8c86e432e8812759e34e6fe82ebac75119ae3237a6c1311fa19caf4?s=96&d=mm&r=g\",\"caption\":\"thecodest\"},\"url\":\"https:\\\/\\\/thecodest.co\\\/nb\\\/author\\\/thecodest\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"G\u00e5r fra Redux til MobX - The Codest","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:\/\/thecodest.co\/nb\/blogg\/gar-fra-redux-til-mobx\/","og_locale":"nb_NO","og_type":"article","og_title":"Going from Redux to MobX","og_description":"The day when you need to get familiar with a different technology is actually every day in a developer\u2019s life. In this particular scenario, I\u2019ve landed in a project that turned out to be the last within the company which uses Redux to manage the state in React app.","og_url":"https:\/\/thecodest.co\/nb\/blogg\/gar-fra-redux-til-mobx\/","og_site_name":"The Codest","article_published_time":"2022-02-17T12:00:00+00:00","article_modified_time":"2026-04-28T14:06:46+00:00","og_image":[{"width":960,"height":540,"url":"https:\/\/thecodest.co\/app\/uploads\/2024\/05\/going_from_redux_to_mobx.png","type":"image\/png"}],"author":"thecodest","twitter_card":"summary_large_image","twitter_misc":{"Written by":"thecodest","Est. reading time":"7 minutter"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/thecodest.co\/blog\/going-from-redux-to-mobx\/#article","isPartOf":{"@id":"https:\/\/thecodest.co\/blog\/going-from-redux-to-mobx\/"},"author":{"name":"thecodest","@id":"https:\/\/thecodest.co\/#\/schema\/person\/7e3fe41dfa4f4e41a7baad4c6e0d4f76"},"headline":"Going from Redux to MobX","datePublished":"2022-02-17T12:00:00+00:00","dateModified":"2026-04-28T14:06:46+00:00","mainEntityOfPage":{"@id":"https:\/\/thecodest.co\/blog\/going-from-redux-to-mobx\/"},"wordCount":1289,"commentCount":0,"publisher":{"@id":"https:\/\/thecodest.co\/#organization"},"image":{"@id":"https:\/\/thecodest.co\/blog\/going-from-redux-to-mobx\/#primaryimage"},"thumbnailUrl":"https:\/\/thecodest.co\/app\/uploads\/2024\/05\/going_from_redux_to_mobx.png","articleSection":["Software Development"],"inLanguage":"nb-NO","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/thecodest.co\/blog\/going-from-redux-to-mobx\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/thecodest.co\/blog\/going-from-redux-to-mobx\/","url":"https:\/\/thecodest.co\/blog\/going-from-redux-to-mobx\/","name":"G\u00e5r fra Redux til MobX - The Codest","isPartOf":{"@id":"https:\/\/thecodest.co\/#website"},"primaryImageOfPage":{"@id":"https:\/\/thecodest.co\/blog\/going-from-redux-to-mobx\/#primaryimage"},"image":{"@id":"https:\/\/thecodest.co\/blog\/going-from-redux-to-mobx\/#primaryimage"},"thumbnailUrl":"https:\/\/thecodest.co\/app\/uploads\/2024\/05\/going_from_redux_to_mobx.png","datePublished":"2022-02-17T12:00:00+00:00","dateModified":"2026-04-28T14:06:46+00:00","breadcrumb":{"@id":"https:\/\/thecodest.co\/blog\/going-from-redux-to-mobx\/#breadcrumb"},"inLanguage":"nb-NO","potentialAction":[{"@type":"ReadAction","target":["https:\/\/thecodest.co\/blog\/going-from-redux-to-mobx\/"]}]},{"@type":"ImageObject","inLanguage":"nb-NO","@id":"https:\/\/thecodest.co\/blog\/going-from-redux-to-mobx\/#primaryimage","url":"https:\/\/thecodest.co\/app\/uploads\/2024\/05\/going_from_redux_to_mobx.png","contentUrl":"https:\/\/thecodest.co\/app\/uploads\/2024\/05\/going_from_redux_to_mobx.png","width":960,"height":540},{"@type":"BreadcrumbList","@id":"https:\/\/thecodest.co\/blog\/going-from-redux-to-mobx\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/thecodest.co\/"},{"@type":"ListItem","position":2,"name":"Going from Redux to MobX"}]},{"@type":"WebSite","@id":"https:\/\/thecodest.co\/#website","url":"https:\/\/thecodest.co\/","name":"The Codest","description":"","publisher":{"@id":"https:\/\/thecodest.co\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/thecodest.co\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"nb-NO"},{"@type":"Organization","@id":"https:\/\/thecodest.co\/#organization","name":"The Codest","url":"https:\/\/thecodest.co\/","logo":{"@type":"ImageObject","inLanguage":"nb-NO","@id":"https:\/\/thecodest.co\/#\/schema\/logo\/image\/","url":"https:\/\/thecodest.co\/app\/uploads\/2024\/03\/thecodest-logo.svg","contentUrl":"https:\/\/thecodest.co\/app\/uploads\/2024\/03\/thecodest-logo.svg","width":144,"height":36,"caption":"The Codest"},"image":{"@id":"https:\/\/thecodest.co\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/pl.linkedin.com\/company\/codest","https:\/\/clutch.co\/profile\/codest"]},{"@type":"Person","@id":"https:\/\/thecodest.co\/#\/schema\/person\/7e3fe41dfa4f4e41a7baad4c6e0d4f76","name":"thecodest","image":{"@type":"ImageObject","inLanguage":"nb-NO","@id":"https:\/\/secure.gravatar.com\/avatar\/5dbfe6a1e8c86e432e8812759e34e6fe82ebac75119ae3237a6c1311fa19caf4?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/5dbfe6a1e8c86e432e8812759e34e6fe82ebac75119ae3237a6c1311fa19caf4?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/5dbfe6a1e8c86e432e8812759e34e6fe82ebac75119ae3237a6c1311fa19caf4?s=96&d=mm&r=g","caption":"thecodest"},"url":"https:\/\/thecodest.co\/nb\/author\/thecodest\/"}]}},"_links":{"self":[{"href":"https:\/\/thecodest.co\/nb\/wp-json\/wp\/v2\/posts\/3260","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thecodest.co\/nb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thecodest.co\/nb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thecodest.co\/nb\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/thecodest.co\/nb\/wp-json\/wp\/v2\/comments?post=3260"}],"version-history":[{"count":11,"href":"https:\/\/thecodest.co\/nb\/wp-json\/wp\/v2\/posts\/3260\/revisions"}],"predecessor-version":[{"id":8555,"href":"https:\/\/thecodest.co\/nb\/wp-json\/wp\/v2\/posts\/3260\/revisions\/8555"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/thecodest.co\/nb\/wp-json\/wp\/v2\/media\/3261"}],"wp:attachment":[{"href":"https:\/\/thecodest.co\/nb\/wp-json\/wp\/v2\/media?parent=3260"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thecodest.co\/nb\/wp-json\/wp\/v2\/categories?post=3260"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thecodest.co\/nb\/wp-json\/wp\/v2\/tags?post=3260"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}