# naivedux

> Naive [redux](https://github.com/reactjs/redux) clone

Latest version **1.1.0** (published 2016-08-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install naivedux
pnpm add naivedux
yarn add naivedux
bun add naivedux
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2016-08-12 |
| First published | 2016-08-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Jo Maxx Blake |
| Maintainers | joblake07 |

## Links

- npm: https://www.npmjs.com/package/naivedux
- Repository: https://github.com/jomaxx/naivedux
- Homepage: https://github.com/jomaxx/naivedux#readme
- Issues: https://github.com/jomaxx/naivedux/issues
- npm.io page: https://npm.io/package/naivedux

## Recent versions

- 1.1.0 (latest) — 2016-08-12
- 1.0.1 — 2016-08-10

## README

# naivedux
Naive [redux](https://github.com/reactjs/redux) clone

## Install
```
npm i naivedux --save
```

## Usage
```js
import { Store } from 'naivedux';

const reducer = (state = {}, action) => {
  const { type, payload } = action;

  switch (type) {
    case 'UPDATE_MESSAGE': {
      return Object.assign({}, state, {
        msg: payload,
      });
    }
    default: {
      return state;
    }
  }
}

const initialState = {
  msg: 'Hello World!',
};

const store = new Store(reducer, initialState);

store.subscribe(() => {
  const { msg } = store.getState();
  document.body.innerText = msg;
});

store.dispatch({
  type: 'UPDATE_MESSAGE',
  payload: 'Goodbye World!',
});
```

---
_Source: https://npm.io/package/naivedux · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
