1629265620
The redux-saga module is a plugin for redux that runs generator-based functions in response to redux actions. Redux-saga generator functions are nice because they behave like co: if you yield a promise, redux-saga will unwrap the promise for you and throw a catchable error if the promise rejects. If you read The 80/20 Guide to ES2015 Generators, a simple saga should look familiar. However, redux-saga intends to keep using generators rather than async/await. In this article, I'll provide a basic example of using redux-saga, explain why redux-saga can't move to async/await, and consider whether you even need redux-saga in the first place.
1592305339
What are the channels? Are they useful to us in day to day programming? We’ll be going through this blog that channels are played really a major role in redux-saga.
Channels:
Channels are of 3 types which are used to perform 3 different things, here I will brief you about those channels here but will explain in detail a bit later.
#react #redux #saga #redux-saga
1620377063
https://www.codecheef.org/article/react-async-await-fetch-api-call-example
#react #fetch-api #async #await #async-await
1597042860
Let’s rewrite the Redux Thunk based React application to Redux Saga.
Code: https://github.com/satansdeer/redux-saga
#react #redux #javascript #saga #thunks
1598839687
If you are undertaking a mobile app development for your start-up or enterprise, you are likely wondering whether to use React Native. As a popular development framework, React Native helps you to develop near-native mobile apps. However, you are probably also wondering how close you can get to a native app by using React Native. How native is React Native?
In the article, we discuss the similarities between native mobile development and development using React Native. We also touch upon where they differ and how to bridge the gaps. Read on.
Let’s briefly set the context first. We will briefly touch upon what React Native is and how it differs from earlier hybrid frameworks.
React Native is a popular JavaScript framework that Facebook has created. You can use this open-source framework to code natively rendering Android and iOS mobile apps. You can use it to develop web apps too.
Facebook has developed React Native based on React, its JavaScript library. The first release of React Native came in March 2015. At the time of writing this article, the latest stable release of React Native is 0.62.0, and it was released in March 2020.
Although relatively new, React Native has acquired a high degree of popularity. The “Stack Overflow Developer Survey 2019” report identifies it as the 8th most loved framework. Facebook, Walmart, and Bloomberg are some of the top companies that use React Native.
The popularity of React Native comes from its advantages. Some of its advantages are as follows:
Are you wondering whether React Native is just another of those hybrid frameworks like Ionic or Cordova? It’s not! React Native is fundamentally different from these earlier hybrid frameworks.
React Native is very close to native. Consider the following aspects as described on the React Native website:
Due to these factors, React Native offers many more advantages compared to those earlier hybrid frameworks. We now review them.
#android app #frontend #ios app #mobile app development #benefits of react native #is react native good for mobile app development #native vs #pros and cons of react native #react mobile development #react native development #react native experience #react native framework #react native ios vs android #react native pros and cons #react native vs android #react native vs native #react native vs native performance #react vs native #why react native #why use react native
1599736380
Very often, you can hear about the state in frontend applications, but what it exactly is? Let me explain.
State in frontend applications represents all the data stored in the application in a given time. It can be stored in different formats like objects or strings. Based on the state’s values, we can personalize the application, display, and hide certain elements.
To manage the state in modern frontend frameworks, we can use different libraries like Redux, MobX, or NgRx. The most common one is Redux, which is used mainly with ReactJS applications, although it’s possible to use it with Angular as well.
With Redux, the state of the application is kept in the store, and we can access the store from every component in the application. Redux consist of store, reducers, and actions.
In this article, I’d like to tell you more about the Redux library and create a simple ReactJS project, where I’ll set up a Redux step by step.
Let’s start!
Redux is based on the flux architecture, and it supports unidirectional data flow. It means that data in the application goes through the same lifecycle over and over again, which makes everything that happens in the state more predictable.
Let’s take a look at the simple graphic, which illustrates the data’s lifecycle in the Redux application.
On the graphic above, you can see that from the UI, we trigger an action that passes the data to the reducer. Next, the reducer updates the store, which is the state of our application. The store defines the user interface.
Let’s think of the benefits which using Redux can bring to our development.
When you’re building the application, you know more or less how much data you will need to manage inside the application. In most cases, frontend applications have some functionality, and very rare they are just static websites. Commonly, we keep some user data, forms data, etc. inside the application state, and then it’s very useful to use a tool for managing the state.
The most popular solution in ReactJS applications is Redux. There are some important benefits to the popularity of this solution. Let’s take a look at them one by one.
Above I listed a few benefits of using Redux to manage the state of your frontend application. Now, I’d like to go to the practical part, where we are going to set up a Redux with ReactJS application.
#javascript #react #redux-saga #frontend #redux