Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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.

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(


,
);
```