Skip to content

Instantly share code, notes, and snippets.

@j-
Created June 6, 2018 01:18
Show Gist options
  • Save j-/14cc42f8f9a2f1b17b64bfa0929674ba to your computer and use it in GitHub Desktop.
Save j-/14cc42f8f9a2f1b17b64bfa0929674ba to your computer and use it in GitHub Desktop.

Separating state and presentation

  • Can migrate applications from one presentation layer (e.g. Angular) to another (e.g. React). Makes migrations less risky, since only the presentation is changing and you know the application logic will continue behaving the same way.

  • Can develop and test application logic independently of the UI. Makes new features quicker to implement since they are smaller changes to make to the app.

  • Testing becomes far simpler since no UI elements need to be emulated. Only data in and data out need to be tested. No need for complicated testing frameworks like Selenium, Protractor or Phantomjs.

  • New features can be implemented in the application well before they are available to the end user. No need to wait until some button has been implemented in the UI before development and testing of application features can begin.

  • Changing UI layout or elements is easier since application logic is not tied to presentation. Allows for rapid iteration of UI development.

  • The same application state can apply to multiple application contexts: desktop web, mobile web, native desktop, native mobile, server etc.

  • State can be moved freely between browser memory, local storage, and server storage. All application logic can interrogate a store asynchronously, and get back data regardless of its origin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment