nanostores
SWR

nanostores | SWR | |
---|---|---|
20 | 259 | |
6,343 | 31,666 | |
2.4% | 0.5% | |
7.6 | 7.4 | |
about 1 month ago | 10 days ago | |
TypeScript | TypeScript | |
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.
nanostores
-
Using nanostores in Astro + Vue setup
use a shared state manager like nanostores
- Nanostores: A tiny (286 bytes) state manager for React/RN/Preact/Vue/Svelte
-
Building jargons.dev [#2]: The Dictionary Search Engine
I retrieved access to files the directory of words using the Astro.glob() function super easily (too bad I couldn't talk about how powerful this function is; how glad I am it existed out-the-box in Astro and how much ease it brought into the flow of getting this search engine up and running) and plugged the returned array of word objects into a $dictionary state (maybe I should call this a store) powered by nanostore (another beautiful stuff right there)
-
Astro.js as an alternative to Next.js: pushing the limits
In its docs, Astro recommends nanostores, but I’ve used effector in the past. And LOVED IT. So I’ve used it for this project as well.
-
React roadmap ( with explanations and resources, all in one place)
Nanostores explanation
-
How to Write a Great Readme
vidstack is very light on technical details but starts with a concise intro and a screenshot, as well as relevant links: https://github.com/vidstack/player
payload is well-structured in general: https://github.com/payloadcms/payload
nanostores starts out with an intro and telling code examples, followed by lots of technical details: https://github.com/nanostores/nanostores
-
Is redux and thunks still used or are there other alternatives for it now?
Nanostores and Reatom are also great, fast atomic libs
-
Is it possible to build a “framework agnostic” library like tanstack table?
Astro handles multi-framework components (React, Vue, etc) and they recommend using the nanostores library for shared state.
-
how to share state between components with distant shared parent?
Checkout Nanostore it's what Astro.build recommends for sharing state across different ui libraries.
-
Building a multi-framework dashboard with Astro
All of these are valid ways of fixing the state management issue, but it's clear that we need to find a common solution that works for all the UI libraries. This is where nanostores comes into play! The description they provide on their GitHub page is simply perfect:
SWR
-
Best Practices for React Applications
For advanced use cases, libraries like React Query or SWR provide caching, refetching, and optimistic updates, simplifying data management in complex applications.
- React’s Four Horsemen of the Frontendpocalypse
-
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
What are some alternatives?
jotai - 👻 Primitive and flexible state management for React
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]
effector-react - Business logic with ease ☄️
TanStack Query - 🤖 Powerful asynchronous state management, server-state utilities and data fetching for the web. TS/JS, React Query, Solid Query, Svelte Query and Vue Query.
tsm - TypeScript Module Loader
redux - A JS library for predictable global state management
