Introduction To Redux

  • Before you start reading this article, I will suggest you read the first part of this Redux series to have a basic understanding of Redux features and functionalities, – – The events happening in the application are called actions.
  • There are 3 core benefits to having immutable state – – To change the store, you dispatch an action that is ultimately handled by a reducer.
  • A reducer is a function that takes state and an action and returns a new state.
  • When the store is created, Redux calls the reducers and uses their return values as an initial state.
  • In this article, we saw what actions, store, and reducers are in Redux.

In this article, we will see what Actions, Store and Reducers are,.
Continue reading “Introduction To Redux”

I’m literally refactoring source code of a #comics. How awesome is that? #ReactJS #CSS

I'm literally refactoring source code of a #comics. How awesome is that?  #ReactJS #CSS

  • This project was bootstrapped with Create React App.
  • This project is very immature.

gradient-company – CSS comics
Continue reading “I’m literally refactoring source code of a #comics. How awesome is that? #ReactJS #CSS”

3 Ways to Fine-tune Presentational Components

Three ways to fine-tune your React presentational components  #reactjs #javascript

  • Here are three ways I’ve found to make React presentational components work as re-usable building blocks.
  • Here are two stories for a text input component: the first shows the component in its valid state, and the second show the component in its invalid state.
  • Instead, extract a new component and pull it up: – – Let the container decide explicitly when and where show presentational components.
  • As you keep pulling presentational components up, they start looking like enhanced native elements, so you’d like to be able to pass all props you would pass to a native element, like or .
  • Inside the component, extract the props you’ve defined yourself and pass the rest to the element that you’re wrapping: – – Here, we’re separating the prop from the rest, and passing the remaining props to the element.


Saturday, Feb 17 2018

in

javascript

react

Continue reading “3 Ways to Fine-tune Presentational Components”

redux-dsm is an easier way to handle async state. v3.0.0 has simplified state graphs. Yay! #reactjs #redux

  • Since I switched to Redux, I handle all of my view state transitions by dispatching action objects, and that requires writing a bunch of boilerplate, such as action types (e.g., ), and action creators (which your view or service layers can call to create actions without forcing you to import…
  • is an object with camelCased keys and strings corresponding to your state transitions.
  • For the above example, it returns: – – will be an object with camelCased keys and function values corresponding to your state transitions.
  • For each transition, an action creator is created which will automatically fill in the correct action type, and pass through to the state.
  • The example fetch state machine will produce the following : – – is a normal Redux reducer function that takes the current state and an action object, and returns the new state.

redux-dsm – Declarative state machines for Redux: Reduce your async-state boilerplate.
Continue reading “redux-dsm is an easier way to handle async state. v3.0.0 has simplified state graphs. Yay! #reactjs #redux”

The most unknown redux performance trick – Julien De Luca – Medium

  • The most unknown redux performance trickRegarding optimizing redux, there are some well known techniques: memoizing, using reselect for example.But there is one that remains unknown to many, although it’s simple and very efficient: The connect’s areStatesEqual option.When state changes, all connect functions will be called, props mapped from state and…
  • Imagine something like this :Considering action addTodo adds a todo item in the todo reducer, when this action will be called, both connect will then be called and mapStateToProps computed.Using areStatesEqual option, you can tell when not to bother to call mapStateToProps at all.The docs say :[areStatesEqual] (Function): When pure, compares incoming…
  • This function is passed 2 arguments: the previous state, and the next state.
  • You return a boolean telling whether the two states have changed, regarding the state slice you’re interested in, and if the function returns true, mapStateToProps will not even be called.Let’s update our example to use this function :Now, when state.users.all changes, the TodoContainer’s areStatesEqual option will be called, it will return…
  • It makes much more sense when using more complex mapStateToProps.Memoization remains useful when using props in mapStateToProps and methods that return new objects or arrays.Perfs gain can be really impressive only using this simple trick.Enjoy !

Regarding optimizing redux, there are some well known techniques: memoizing, using reselect for example. But there is one that remains unknown to many, although it’s simple and very efficient: The…
Continue reading “The most unknown redux performance trick – Julien De Luca – Medium”

Math: the React.js Way – Hacker Noon

Math: the React.js Way

☞ 

#reactjs #javascript

  • Math: the React.js WayHave you found yourself doing intense math problems using weird symbols like +, −, á, and×?
  • Thanks to react-real-math you can now harness the power of the React.js Virtual DOM to make your Math blazing🔥 fast!react-real-math provides an incredibly easy to understand API out of the gate, for free.
  • Let’s take a look at an example of react-real-math in action.
  • Consider this old-school almost obfuscated math problem:1+1×2=?
  • If you would like to contribute to react-real-math please check out the project’s

Have you found yourself doing intense math problems using weird symbols like +, −, ÷, and×? Do you enjoy the speed and developer experience of React.js? Thanks to react-real-math you can now harness…
Continue reading “Math: the React.js Way – Hacker Noon”

The most unknown redux performance trick – Julien De Luca – Medium

  • The most unknown redux performance trickRegarding optimizing redux, there are some well known techniques: memoizing, using reselect for example.But there is one that remains unknown to many, although it’s simple and very efficient: The connect’s areStatesEqual option.When state changes, all connect functions will be called, props mapped from state and…
  • Imagine something like this :Considering action addTodo adds a todo item in the todo reducer, when this action will be called, both connect will then be called and mapStateToProps computed.Using areStatesEqual option, you can tell when not to bother to call mapStateToProps at all.The docs say :[areStatesEqual] (Function): When pure, compares incoming…
  • This function is passed 2 arguments: the previous state, and the next state.
  • You return a boolean telling whether the two states have changed, regarding the state slice you’re interested in, and if the function returns true, mapStateToProps will not even be called.Let’s update our example to use this function :Now, when state.users.all changes, the TodoContainer’s areStatesEqual option will be called, it will return…
  • It makes much more sense when using more complex mapStateToProps.Memoization remains useful when using props in mapStateToProps and methods that return new objects or arrays.Perfs gain can be really impressive only using this simple trick.Enjoy !

Regarding optimizing redux, there are some well known techniques: memoizing, using reselect for example. But there is one that remains unknown to many, although it’s simple and very efficient: The…
Continue reading “The most unknown redux performance trick – Julien De Luca – Medium”

Math: the React.js Way – Hacker Noon

Math: the React.js Way

☞ 

#reactjs #javascript

  • Math: the React.js WayHave you found yourself doing intense math problems using weird symbols like +, −, á, and×?
  • Thanks to react-real-math you can now harness the power of the React.js Virtual DOM to make your Math blazing🔥 fast!react-real-math provides an incredibly easy to understand API out of the gate, for free.
  • Let’s take a look at an example of react-real-math in action.
  • Consider this old-school almost obfuscated math problem:1+1×2=?
  • If you would like to contribute to react-real-math please check out the project’s

Have you found yourself doing intense math problems using weird symbols like +, −, ÷, and×? Do you enjoy the speed and developer experience of React.js? Thanks to react-real-math you can now harness…
Continue reading “Math: the React.js Way – Hacker Noon”

The Official Microsoft ASP.NET Site

CORE 2 and ANGULAR 4
☞ 
#angularjs #angular #js #react #js

  • The product(s) you are about to install leverage the Web Platform Installer (WebPI) for installation.
  • By downloading and using the Web Platform Installer (WebPI), you agree to the license terms and privacy statement for WebPI.
  • This installer will contact Microsoft over the Internet to retrieve product information.
  • WebPI uses the Microsoft Customer Experience Improvement Program (CEIP), which is turned on by default, see privacy statement for more information.
  • To view which software uses CEIP, see here.

Home of the Microsoft ASP.NET development community. Download Visual Studio, post to the forums, read ASP.NET blogs and learn about ASP.NET.
Continue reading “The Official Microsoft ASP.NET Site”

The joy of React+Redux with Elixir/OTP

The joy of React+Redux with Elixir/OTP  #ReactJS #Redux #Elixir

  • Graphically, this is the schema of a Redux app: – – Basically, Redux does the following: – – An OTP GenServer does the following: – – In short, we can use the same mental model for the client and server side.
  • We can dispatch events to Elixir, compute a new version state server side, propagate this state to redux, and our views will get updated automatically.
  • We have just implemented the thick red arrows: – – We will update the store with the state that comes from the server in two different situations.
  • With this, we have connected the server state with Redux state.
  • But, if you want to have state shared between different users, or we want to have pieces of the state in the server for other reasons, such as enforcing validation rules, we can use the same mental mode with Elixir GenServers.

Digital solutions partner. High quality work with Symfony, React and Elixir.
Continue reading “The joy of React+Redux with Elixir/OTP”