# taro-dva

> Use 'dva-core' for Taro.

Latest version **1.0.0** (published 2018-08-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install taro-dva
pnpm add taro-dva
yarn add taro-dva
bun add taro-dva
```

## 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 | 2018-08-20 |
| First published | 2018-08-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 879 B |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 14 |
| Author | Yeqin Gong |
| Maintainers | kankungyip |

## Links

- npm: https://www.npmjs.com/package/taro-dva
- Repository: https://github.com/kankungyip/taro-dva
- Homepage: https://github.com/kankungyip/taro-dva#readme
- Issues: https://github.com/kankungyip/taro-dva/issues
- npm.io page: https://npm.io/package/taro-dva

## Dependencies (1)

- [dva-core](https://npm.io/package/dva-core.md) ^1.4.0

## Recent versions

- 1.0.0 (latest) — 2018-08-20

## README

Taro-dva
===

Taro 可以使用 Redux 数据流方案，我习惯了使用 dva，基于 dva-core 写了一个 taro-dva 库，方便在 Taro 中使用。

## 安装

可选安装 `dva-immer` 和 `dva-loading`。

```bash
$ yarn add taro-dva dva-immer dva-loading
```

## 使用

```jsx app.js
import Taro, { Component } from '@tarojs/taro'
import { Provider } from '@tarojs/redux'
import { createStore } from 'taro-dva'

const store = createStore({
  useImmer: true, // 使用 dva-immer

  useLoading: {   // 使用 dva-loading
    effect: true,
  },

  models: [
    require('./models/g').default,
  ],
})

class App extends Component {
  config = {
    pages: [
      'pages/Index/index',
    ],
    window: {
      navigationBarBackgroundColor: '#fff',
      navigationBarTitleText: 'WeChat',
      navigationBarTextStyle: 'black',
    },
  }

  render () {
    return (
      <Provider store={store}>
        <Index />
      </Provider>
    )
  }
}

Taro.render(<App />, document.getElementById('app'))

```

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