# loading-watch-mobx

> watch loading by Reactive style

Latest version **2.0.3** (published 2020-12-14) · ISC license · 0 weekly downloads

## Install

```sh
npm install loading-watch-mobx
pnpm add loading-watch-mobx
yarn add loading-watch-mobx
bun add loading-watch-mobx
```

## 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 | 2.0.3 |
| Published | 2020-12-14 |
| First published | 2020-04-23 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | lirongping |
| Maintainers | khan123 |
| Keywords | loading-watch, mobx, react, react-easy-state |

## Links

- npm: https://www.npmjs.com/package/loading-watch-mobx
- Repository: https://github.com/hobserver/loading-watch
- Homepage: https://github.com/hobserver/loading-watch#readme
- Issues: https://github.com/hobserver/loading-watch/issues
- npm.io page: https://npm.io/package/loading-watch-mobx

## 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

- 2.0.3 (latest) — 2020-12-14
- 1.0.4 — 2020-11-16
- 1.0.3 — 2020-11-16
- 1.0.2 — 2020-11-15
- 2.0.2 — 2020-06-15
- 1.0.1 — 2020-04-23

## README

# 说明
dva的loading方法很好用, mobx版本的呢?

本插件就是解决这个问题

让你在mobx版本使用loading的解决方案

# 安装

## mobx版本: 
```
npm install loading-watch-mobx --save
```
## react-easy-state体系
使用 @nx-js/observer-util 体系的
```
npm install loading-watch-observer-util --save
```

# 使用
### model
```
import {loadingWatch} from 'loading-watch-observer-util';
import {observable} from 'mobx';
const data = observable(new class {
    @loadingWatch
    async getList() {
        return await request(...);
    }
});
```


### component
```
import {loading} from 'loading-watch-observer-util';
import dataModel from './model';
@observer
class Com extends React.Component {
    componentDidMount() {
        dataModel.getList();
    }
    render() {
        return <div>
            {loading.get(dataModel, 'getList') ? 'loading...' : 'already loading'}
        </div>
    }
}
```

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