Interview of @hrmny_ about Parket, a light state management library inspired by mobx-state-tree #mobx #reactjs

  • I am currently working as a freelance full-stack developer.
  • Parket is a state management library; a well-known example would be Redux.
  • Parket lets you create models with a state, actions, and views; these can later be used by instantiating them and can be nested inside each other.
  • As you can see here, Parket doesn’t care what your action does or instead what it is; it just listens to state changes.
  • It’s always nice to see new approach to state management.

State management is one of those topics that divides opinions. So far we’ve seen a couple of option…
Continue reading “Interview of @hrmny_ about Parket, a light state management library inspired by mobx-state-tree

#mobx #reactjs”

How I organize my React & Redux projects – Bruno Quaresma – Medium

How I organize my React & Redux projects  #javascript #react #redux #reactjs

  • So, in order to reuse some domain logic like a Payment feature you will need to enter in every function folder and move the respective files and tests to a separeted folder to create a lib.
  • Problems solved… In parts…I think that the views(visual components/dumb components) are not part of the domain because the views are just a way to decorate some data to display to the user.
  • It’s the best part to use and reuse components.Then, I extracted the views from all domains folder and created a components folder in src directory.
  • Therefore, after some reflection, I decided to create a folder called modules and put all the logical domain inside.Another point that I think that is important to care about is the screens folder.
  • The answer to this is because the components folder is for reusable visual components(dumb components) as opposed to screens which are very coupled with the current application.The utils folder is used to keep some logic that can be extracted from the code but is not about the application domain, e.g. string/array operations.If you have a differente point of view, let me know.

In this post, I will share with you how I organize my React & Redux projects and talk about some decisions that I made while working in some projects in the last two years. This structure groups each…
Continue reading “How I organize my React & Redux projects – Bruno Quaresma – Medium”

React Native Effective Patterns – The Poli – Medium

React Native Effective Patterns  #software #mobile #javascript #reactnative #react #reactjs

  • Your views and components should rely on props and callbacks.
  • The idea is simple:Screens and Views are not the same.
  • FavoritesScreen uses that callback to tell the view to navigate to another screen.
  • Keep your callbacks chained togetherEvery time one of your views exposes a callback which may be declared in another part of the app (for example, mapStateToProps), first invoke the actual callback passed on props.
  • This enables you to, for example, Navigate to a screen and also fetch some information to feed the next view.Following the previous example, if FavoritesScreen told FavoritesView to navigate to the FavoriteScreen when selecting a Favorite, Redux would honor that, but also invoke some Redux actions.As you may see, every realm knows how to handle its stuff: Screens know how to navigate, Connected Views know how to handle redux actions and Views are dumb, stateless and rely on their props.5.

I’ve been working with React Native for quite a while now, both professionally and personally, and actually enjoy it. In this article I will describe some patterns I use. Keep in mind that whatever…
Continue reading “React Native Effective Patterns – The Poli – Medium”

What the Flux? – Gina Yeon – Medium

What the Flux?  #flux #react #reactjs

  • It complements React’s composable view components by utilizing a unidirectional data flow.Flux has 4 major / React ComponentsThe unidirectional data flow allows Flux to shy away from the what we’re more familiar with — the MVC structure.MVC Structure and FlowWhen a user interacts with a React View, it kicks off an action through the dispatcher, to the stores that hold the data, which then updates all of the views that are affected.Flux Structure and Data FlowThe unidirectional pattern means that data flows in a single direction.
  • The action, dispatcher, store, and view are independent nodes with distinct inputs and outputs.
  • The actions are simple objects containing new data and an identifying type property.Sometimes, the views may cause a new action to be sent through the system depending on the UI.Actions are provided to the dispatcher through action creators originating from the views, through user interaction.
  • The dispatcher, acting as a central hub, will then take those actions and invoke callbacks registered by the stores and send the actions to the stores.
  • These views will listen for that change event through event handlers will call their own setState() method to then re-render themselves and all of their descendants in the component tree.Flux, with Harry PotterSeverus Snape is patrolling the halls of Hogwarts to make sure no students are out of bed.

When I first started researching Flux, it was described as an application architecture. I thought, “Great, I know architecture, this should make sense.” Little did I know, architecture in the tech…
Continue reading “What the Flux? – Gina Yeon – Medium”