Redux: Persist Your State – Async LA – Medium

Redux: Persist Your State  #redux #react #reactnative #reactjs #reactjs

  • You create your store from scratch, initialize state, and maybe set some basic state based on the url (if you are in a browser).
  • But the blob could be days, weeks or years old!Redux Persist provides a consistent, performant, and structured way to persist state.If you still require more convincing, read Jani Eväkallio’s piece on offline first applications.Part 2: Architecture2.1 The Component PartsThe “persistence layer” is actually two stateful reactive objects, plus a higher…
  • It also creates register and rehydrate methods which will be used to register each persistoid, and dispatch the actual rehydrate action respectively.PersistoidThe persistoid is the actual state sink.
  • additionally it handles the PURGE action for clearing stored state.2.2 Whats new in Redux Persist v5code splitting reducersbetter integration story for libs (e.g. redux-offline)ability to colocate persistence rules with the reducer it pertains tofirst class migration supportenable PersistGate react component which blocks rendering until persistence is complete (and enables similar patterns…
  • Thats means a consistent story around extensibility, and the ability to use redux-devtools to debug any tricky issues internal to the persistence layer.Ergonomic ReduxVanilla Redux requires a ton of ceremony to use.

When your app reloads, the javascript process has nothing in memory. You create your store from scratch, initialize state, and maybe set some basic state based on the url (if you are in a browser)…
Continue reading “Redux: Persist Your State – Async LA – Medium”

Carry #GitHub in your pocket with #GitPoint: #ReactJS #ReactNative

Carry #GitHub in your pocket with #GitPoint:  #ReactJS #ReactNative

  • Built with React Native, GitPoint is the most feature-rich unofficial GitHub client that is 100% free.
  • A few of the things you can do with GitPoint:

    Feel free to send me feedback on twitter or file an issue.

  • Also, if there’s anything you’d like to chat about, please feel free to join our gitter chat!
  • Please take a look at the contributing guidelines for a detailed process on how to build your application as well as troubleshooting information.
  • Feel free to use them or use a new set of keys by creating an OAuth application of your own

git-point – GitHub in your pocket :iphone:
Continue reading “Carry #GitHub in your pocket with #GitPoint: #ReactJS #ReactNative”

Building a Card Swiper in React Native

  • There’s way too many things this component exposes as props.
  • The Animator wraps your card components to make them tossable.
  • This first one is the Card component.
  • The only things I see needing optimizations other than the rendering performance is how the actions bar is hooked into the card stack.
  • It’s my hope with the community’s help we can make this the best card swiper for React Native.

This past month, a friend and I have been working on releasing React Screens. We plan on making two screens, complete with various UI elements that you can use some of, or the whole screen, in your own React Native apps.
Continue reading “Building a Card Swiper in React Native”

Rewriting Transmission UI with React – Hacker Noon

Rewriting Transmission UI with #reactjs – Hacker Noon

  • This forces you to always work with the same mentality not allowing you to test new approaches to solve problems.Following our desire to learn new stuff to make our life easier, we wanted to experiment with new technology to build a side project with a complete new stack that fits better with the app requirements.In that same week, a friend of mine was talking about a bug that was affecting him in the web client of Transmission.
  • We decided to start building a new interface from scratch to understand new patterns, new approaches and discover what would be the next challenges for the ultimate interface.Our experimental stackReviewing all of the features in the current Transmission web client, the stack we chose was React for the user interface, Mobx for the state management and CSS modules for all the stuff related with the application styles, with a new build process managed by Webpack.On the other hand, and with the above stack in mind, we decided to use some best practices for the long term quality of this project.
  • New tools have appeared during the last 5 years to improve our life like SASS, LESS or CSS Modules.If you are used to code big sets of components you can make the common mistake of reuse style classes for different components.
  • This is important because most of the components contain several paths and we need to ensure that each one is covered.Integrating this new set of tests to some CI we can be more confident about future changes that we apply to the application.As we can see in this example we are rendering the Progress bar component with mocked torrent data.Then with the snapshot technique we can ensure that the rendered result is what we expect comparing with previous snapshot.
  • So we decided to follow the current design, we just wanted to propose a new code architecture.We didn’t want to impact the end users in case that this code were considered for inclusion in the main Transmission repository.Lastly, even if the project dies out, for whatever reason, we’re happy anyway, because we learnt a lot of things and had a really fun time during its development.

I remember it was about two months ago when I was talking with Eduardo Lanchares about the best stack for the next webapp. Sometimes you are at work and you are stuck with the current set-up of…
Continue reading “Rewriting Transmission UI with React – Hacker Noon”