# react-teemo

> '基于redux-saga模仿dva的react状态管理器 '

Latest version **1.0.0** (published 2019-11-04) · ISC license · 0 weekly downloads

## Install

```sh
npm install react-teemo
pnpm add react-teemo
yarn add react-teemo
bun add react-teemo
```

## 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.0 |
| Published | 2019-11-04 |
| First published | 2019-11-04 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 6.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | zhou yang |
| Maintainers | engineerzy |
| Keywords | react, dva, temmo, redux-saga |

## Links

- npm: https://www.npmjs.com/package/react-teemo
- Repository: https://github.com/engineerzy/Teemo
- Homepage: https://github.com/engineerzy/Teemo#readme
- Issues: https://github.com/engineerzy/Teemo/issues
- npm.io page: https://npm.io/package/react-teemo

## 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.0 (latest) — 2019-11-04

## README

## 项目描述

基于redux-saga的react数据处理方法，模仿dva，
传入模块文件，启动项目

### 模块文件结构如下

```javascript
import { delay } from "redux-saga/effects"
import * as types from "types" // action类型文件，根据文件大小决定是否单独新开一个文件
export default {
    namespace: 'nav',
    state: {
        age: 18,
        name: '张三'
    },
    effect: {
        *add_age_async({ num },{put,call,select}) {
            yield delay(1000)
            yield put({type: types.ADD_AGE_SYNC,num: num})
        }
    },
    reducers: {
        [types.ADD_AGE_SYNC](state, action) {
            return {
                ...state,
                age: action.num + state.age
            }
        },
        add_age_async(state,action) {
            return {
                ...state,
                age: 2 + state.age
            }
        }
    }
}
```

### 启动

```javascript
import createTeemo from "Teemo"
import home from "home" // 模块文件
import nav from "nav" // 模块文件

const store = createTeemo({
    models: [home,nav]
})
export default store

```

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