Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/amos-project/amos
A decentralized, data structure-based, fully featured state management library.
https://github.com/amos-project/amos
reactjs recoil redux state-mangement vuex
Last synced: 2 months ago
JSON representation
A decentralized, data structure-based, fully featured state management library.
- Host: GitHub
- URL: https://github.com/amos-project/amos
- Owner: amos-project
- License: mit
- Created: 2020-11-01T14:04:08.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2024-10-24T08:23:22.000Z (3 months ago)
- Last Synced: 2024-10-24T12:23:51.243Z (3 months ago)
- Topics: reactjs, recoil, redux, state-mangement, vuex
- Language: TypeScript
- Homepage: https://amos-project.github.io/amos/
- Size: 13 MB
- Stars: 12
- Watchers: 7
- Forks: 2
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Amos
A decentralized, data structure-based, fully featured state management library.
## Highlights
- Decentralized (or, in a more trendy term: atomic).
- Data structure-based: help you read/write state easily.
- Strong TypeScript support.
- All in one: everything in a single package `amos` with zero dependencies, including:
- All commonly used data structures: Number, Boolean, Array, Object, List, Map.
- Box relationships.
- Batch.
- Concurrent.
- Cache.
- React: Query, Suspense, Use.
- SSR.
- HTTP: Paging, Optimistic, Offline, Structure mapping.
- Persistence: including Web, React Native, IndexedDB, SQLite.
- Devtools.
- Redux compatible, helping you seamlessly and smoothly migrate from Redux to amos.## Install
You can get everything via install npm package `amos`:
```bash
# via npm
npm i -S amos
# via yarn
yarn add amos
# via pnpm
pnpm i amos
```## Documentation
You can find the Amos documentation [on the website](https://amos-project.github.io/amos/).
## Quick start
```typescript jsx
import { createStore, numberBox } from 'amos';
import { Provider, useDispatch, useSelector } from 'amos/react';
import { createRoot } from 'react-dom/client';const countBox = numberBox('count');
function Count() {
const dispatch = useDispatch();
const count = useSelector(countBox);return (
Click count: {count}.
dispatch(countBox.add(1))}>Click me
);
}const store = createStore();
createRoot(document.getElementById('root')!).render(
,
);
```