SWR
redux-saga

SWR | redux-saga | |
---|---|---|
256 | 47 | |
31,431 | 22,545 | |
0.6% | -0.0% | |
7.6 | 2.8 | |
26 days ago | 6 months ago | |
TypeScript | JavaScript | |
MIT License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
SWR
-
Effective Patterns for Shared State Management in React
For server-state (data fetched from an API), tools like React Query or SWR shine. They handle caching, refetching, and error states without needing to push API responses into Redux.
-
useSWR usage in vercel/ai-chatbot hooks.
Following is overview picked from SWR site.
-
Using React Suspense with Data Fetching and Concurrent Rendering.
If you need more robust features—like caching, re-fetching, or pagination—check out libraries like React Query or SWR. Many of these tools also offer optional Suspense modes, so you can keep your data-fetching code clean while benefiting from powerful caching and refetching mechanisms.
-
Mastering CRUD with NextJS
Client-Side Data Fetching with useQuery can be used for interactive components that need to fetch data on the client-side, with initial state hydrated from server-side fetched data. For fetching data that changes frequently or for adding client-side interactivity it is useful the useSWR strategy. It’s a React hook for client-side data fetching with caching and revalidation. It allows fetching data on the client side, usually after the initial page load. Nevertheless, it does not fetch data at build time or on the server for SSR, but it can revalidate and fetch new data when required.
-
Is React as hard/complex as it sounds?
SWR for lightweight data fetching
- Session State Management | JS | React
-
Essential Frontend Resources for Next.js Development 🚀
⚡ SWR Documentation
-
In-Depth Comparison: How to Choose the Most Suitable Enhanced Request Library
swr
-
The Evolution of React State Management: From Local to Async
We can do this with React-Query, SWR, Redux Toolkit Query and many others.
-
Building a subscription tracker Desktop and iOS app with compose multiplatform—Providing feedbacks
This is a common approach in JS land, and there are plenty of libraries that help abstract the logic and make sure the state is consistent, like swr or TanStack Query.
redux-saga
-
UmiJS: the Shaolin of web frameworks
Dva. A plugin-based state management solution (Redux + Sagas). Also quite popular in narrow communities outside of the Umi world.
- Redux-Saga – An intuitive Redux side effect manager
-
Understanding Redux: A tutorial with examples
Redux Saga uses generator functions to manage side effects in Redux. The code below illustrates the use of yield put, which basically acts as the Saga effect creator used to dispatch actions to the Redux store:
-
Redux vs. Context.Provider: Choosing State Management in React Applications
Handling Asynchronous Logic: If your application involves complex asynchronous logic (e.g., API calls, side effects), Redux middleware like redux-thunk or redux-saga provides a robust way to handle these scenarios.
- Understanding React Compiler
- Main-Thread-Scheduling
-
Creating Own Chat GPT
For the backend, we chose Python, Django Rest Framework. On the frontend, React, Redux, Saga, Sass. Let’s start with the backend, which was managed by Yegor. He writes about the server part of the project himself.
-
Internals of Async / Await in JavaScript
The whole article properly the best explanation of generators I have come across. This quote stuck out:
> Generators are a special type of function that can return multiple pieces of data during its execution. Traditional functions can return multiple data by using structures like Arrays and Objects, but Generators return data whenever the caller asks for it, and they pause execution until they are asked to continue to generate and return more data.
Applications of generators? I have only used Redux-Saga[1]. Can't even think of other libraries that use them, but would be interested in learning.
[1]: https://redux-saga.js.org/
-
Generators in the wild
redux-saga. The most popular effects library in js
-
I don't get why I should use Redux
Redux can be extended with a lot of other packages. For example with a side effect manager, you can separate side effects from your business logic, help with error handling and in the same process make testing of side effects a lot easier.
What are some alternatives?
react-query - 🤖 Powerful asynchronous state management, server-state utilities and data fetching for TS/JS, React, Solid, Svelte and Vue. [Moved to: https://github.com/TanStack/query]
redux-toolkit - The official, opinionated, batteries-included toolset for efficient Redux development
axios - Promise based HTTP client for the browser and node.js
zustand - 🐻 Bear necessities for state management in React
reselect - Selector library for Redux
