# mobx-react-autorun

> A small react HOC to run a mobx autorun function when a component mounts, and dispose of it when the component will unmount.

Latest version **1.0.2** (published 2017-08-31) · MIT license · 0 weekly downloads

## Install

```sh
npm install mobx-react-autorun
pnpm add mobx-react-autorun
yarn add mobx-react-autorun
bun add mobx-react-autorun
```

## 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.2 |
| Published | 2017-08-31 |
| First published | 2017-08-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Damien Timewell |
| Maintainers | idlefingers |

## Links

- npm: https://www.npmjs.com/package/mobx-react-autorun
- Repository: https://github.com/idlefingers/mobx-react-autorun
- Homepage: https://github.com/idlefingers/mobx-react-autorun#readme
- Issues: https://github.com/idlefingers/mobx-react-autorun/issues
- npm.io page: https://npm.io/package/mobx-react-autorun

## Dependencies (1)

- [hoist-non-react-statics](https://npm.io/package/hoist-non-react-statics.md) ^2.3.1

## Recent versions

- 1.0.2 (latest) — 2017-08-31
- 1.0.1 — 2017-08-31
- 1.0.0 — 2017-08-30

## README

# mobx-react-autorun

A small react HOC to run a mobx autorun function when a component mounts, and dispose of it when the component will unmount.

```
import React from "react"
import { observer } from "mobx-react"
import autorunner from "mobx-react-autorun"

@autorunner @observer
export default class MyComponent extends React.Component {

  autorunner = () => {
    // this function will run like any normal mobx autorun function,
    // so it will automatically react to changes in your
    // observables. Just remember to make the component an observer!
  }

  render() {
    return (
      <div>
        Hello world
      </div>
    )
  }

}
```

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