0.2.6 • Published 9 months ago

amos v0.2.6

Weekly downloads
3
License
MIT
Repository
github
Last release
9 months ago

amos

Amos is an out-of-the-box state management library designed for large scale projects.

The amos is the all-in-one package for all the builtin modules of amos. It includes several entrypoint, each entrypoint contains one or more packages. The entrypoint are:

entrypointincluded packages
amosamos-coreamos-boxesamos-shapesamos-ioamos-persistamos-devtoolsamos-utils
amos/reactamos-react
amos/reduxamos-redux

Install

npm i -S amos
# or via yarn
yarn add amos

Quick start

import { createStore, NumberBox } from 'amos';
import { Provider, useDispatch, useSelector } from 'amos-react';
import { createRoot } from 'react-dom/client';

const countBox = new NumberBox('count');

function Count() {
  const dispatch = useDispatch();
  const [count] = useSelector(countBox);

  return (
    <div>
      <span>Click count: {count}</span>
      <button onClick={() => dispatch(countBox.add(1))}>Click me</button>
    </div>
  );
}

const store = createStore();

createRoot(document.getElementById('root')!).render(
  <Provider store={store}>
    <Count />
  </Provider>,
);
0.3.0-beta.1

9 months ago

0.2.6

2 years ago

0.2.5

3 years ago

0.2.1

3 years ago

0.2.3

3 years ago

0.2.2

3 years ago

0.2.4

3 years ago

0.2.0

3 years ago

0.1.5

3 years ago

0.1.4

3 years ago

0.1.3

3 years ago

0.1.0

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.0.2

4 years ago

0.0.1

4 years ago