# min-redux

> mini redux & study how to write a redux

Latest version **1.0.1** (published 2017-08-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install min-redux
pnpm add min-redux
yarn add min-redux
bun add min-redux
```

## 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.0.1 |
| Published | 2017-08-14 |
| First published | 2017-08-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | maczyt |
| Maintainers | maczyt |
| Keywords | redux, react |

## Links

- npm: https://www.npmjs.com/package/min-redux
- Repository: https://github.com/maczyt/min-redux
- Homepage: https://github.com/maczyt/min-redux#readme
- Issues: https://github.com/maczyt/min-redux/issues
- npm.io page: https://npm.io/package/min-redux

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2017-08-14
- 1.0.0 — 2017-08-13

## README

# simple-redux

[![npm](https://img.shields.io/npm/dw/localeval.svg)](https://github.com/maczyt/min-redux)
[![GitHub stars](https://img.shields.io/github/stars/maczyt/min-redux.svg)](https://github.com/maczyt/min-redux/stargazers)
[![GitHub issues](https://img.shields.io/github/issues/maczyt/min-redux.svg)](https://github.com/maczyt/min-redux/issues)
[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/maczyt/min-redux/master/LICENSE)

> You will get how to write a redux-like by yourself

``` js

import { createStore } from './index'

function counter(state = 0, action) {
  switch(action.type) {
    case 'INCREMENT':
      return state + 1
    case 'DECREMENT':
      return state - 1
    default:
      return state
  }
}

const store = createStore(counter)

store.subscribe(() => console.log(store.getState()))

store.dispatch({ type: 'INCREMENT' })
// 1
store.dispatch({ type: 'INCREMENT' })
// 2
store.dispatch({ type: 'DECREMENT' })
// 1

```


## 参考文档

- [redux tutorial](https://github.com/react-guide/redux-tutorial-cn)

## 已支持

- `createStore`
  - `subscribe`
  - `getState`
  - `dispatch`
- `combineReducers`

## 待补充

- `bindActionCreators`
- `applyMiddleware`
- `actionCreator`

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