# mobx-method-decorators

> ![Node.js CI](https://github.com/mk2/mobx-method-decorators/workflows/Node.js%20CI/badge.svg?branch=master)

Latest version **0.0.7** (published 2020-04-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install mobx-method-decorators
pnpm add mobx-method-decorators
yarn add mobx-method-decorators
bun add mobx-method-decorators
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.7 |
| Published | 2020-04-14 |
| First published | 2020-01-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 11.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | harukao |

## Links

- npm: https://www.npmjs.com/package/mobx-method-decorators
- Repository: https://github.com/mk2/mobx-method-decorators
- Homepage: https://github.com/mk2/mobx-method-decorators#readme
- Issues: https://github.com/mk2/mobx-method-decorators/issues
- npm.io page: https://npm.io/package/mobx-method-decorators

## Dependencies (1)

- [type-fest](https://npm.io/package/type-fest.md) ^0.8.1

## Recent versions

- 0.0.7 (latest) — 2020-04-14
- 0.0.6 — 2020-01-16
- 0.0.5 — 2020-01-16
- 0.0.4 — 2020-01-15
- 0.0.3 — 2020-01-15
- 0.0.2 — 2020-01-15
- 0.0.1 — 2020-01-15

## README

![Node.js CI](https://github.com/mk2/mobx-method-decorators/workflows/Node.js%20CI/badge.svg?branch=master)

# mobx-method-decorators

- Assist `reaction(...)` calling with class-oriented way.

## How to use?

### isntall

```sh
yarn add mobx-method-decorators
```

### write code

```ts
import mobx from 'mobx';
import { ReactableMixin, reactionMethod } from 'mobx-method-decorators';

const store = mobx.observable({
  message: 'Hello world.',
});

class Sample extends ReactableMixin {
  constructor() {
    this.makeReactable();
  }

  @reactionMethod(() => store.message)
  method() {
    // Execute whenever store.message changed.
  }

  detach() {
    // Dispose any reactions, call `unmakeReactable`
    this.unmakeReactable();
  }
}
```

## Copyright

MIT

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