Hands-On Design Patterns with React Native by Mateusz Grzesiukiewicz
Author:Mateusz Grzesiukiewicz
Language: eng
Format: epub
Publisher: Packt Publishing
Published: 2018-09-29T06:54:53+00:00
Moving to MobX
In this section, we will refactor the Tasks application to use MobX instead of vanilla Flux.
The Tasks application was developed in the previous chapters. If you have jumped straight to this chapter, please have a look at the application located at src / Chapter 4 / Example 1_ Todo app with Flux, in the GitHub repository.
Before we dive in, install the two packages using the following command:
yarn add mobx mobx-react
Okay, first, let's clean up unneeded pieces:
AppDispatcher.js: Dispatching is done by MobX using observables behind the scenes.
TaskActions.js: Actions will now live in TaskStore and work on its state. In MobX, you will most likely end up with many stores, so this is not a big issue—we keep related things together.
TasksActionTypes.js: There is no need to define this. MobX will take care of it internally.
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Hello! Python by Anthony Briggs(9379)
OCA Java SE 8 Programmer I Certification Guide by Mala Gupta(9347)
The Mikado Method by Ola Ellnestam Daniel Brolund(9314)
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(7857)
Sass and Compass in Action by Wynn Netherland Nathan Weizenbaum Chris Eppstein Brandon Mathis(7406)
Test-Driven iOS Development with Swift 4 by Dominik Hauser(7328)
Grails in Action by Glen Smith Peter Ledbrook(7303)
The Well-Grounded Java Developer by Benjamin J. Evans Martijn Verburg(7122)
Secrets of the JavaScript Ninja by John Resig Bear Bibeault(5962)
Kotlin in Action by Dmitry Jemerov(4647)
Hands-On Full-Stack Web Development with GraphQL and React by Sebastian Grebe(3891)
Functional Programming in JavaScript by Mantyla Dan(3723)
Learning Java by Patrick Niemeyer & Daniel Leuck(2872)
Mastering Python for Finance by Weiming James Ma;(2840)
Learning React: Functional Web Development with React and Redux by Banks Alex & Porcello Eve(2839)
Windows APT Warfare by Sheng-Hao Ma(2627)
WordPress Plugin Development Cookbook by Yannick Lefebvre(2605)
Mastering Java 9 by Dr. Edward Lavieri(2573)
Architecting Modern Java EE Applications: Designing lightweight, business-oriented enterprise applications in the age of cloud, containers, and Java EE 8 by Daschner Sebastian(2560)