# react-plunge

> **NOT IMPLIMENTED YET:** See [Plunge](https://github.com/gwing33/plunge) for more info on that.

Latest version **0.0.1** (published 2015-07-14) · ISC license · 0 weekly downloads

## Install

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

## 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.1 |
| Published | 2015-07-14 |
| First published | 2015-07-14 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Gerald Leenerts |
| Maintainers | gwing33 |

## Links

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

## Dependencies (3)

- [react](https://npm.io/package/react.md) ^0.13.3
- [plunge](https://npm.io/package/plunge.md) 0.0.1
- [babel-core](https://npm.io/package/babel-core.md) ^5.6.20

## Recent versions

- 0.0.1 (latest) — 2015-07-14

## README

# React Plunge

**NOT IMPLIMENTED YET:** See [Plunge](https://github.com/gwing33/plunge) for more info on that.

React Plunge is a High Order Function that binds store like data to a component as ``props``.
State is preserved within the React Plunge Component

## TODO
- [x] Get the proof of concept working.
- [ ] Write tests around the component.
- [ ] Get an example up and running.

### Install
```bash
npm install react-plunge
```

### Usage
```javascript
'use strict';
import React from 'react';
import plunge from 'react-plunge';

class Index extends React.Component {
  _onClick() {
    this.props.ApiData.store.add({
      clicks: this.props.ApiData.data.clicks + 1
    });
  }

  render() {
    let clicks = this.props.ApiData.data.clicks;
    let text = clicks == 1 ? 'Beer' : 'Beers';

    return (
      <div styles={[ LayoutStyle.center, LayoutStyle.half, styles.container ]}>
        <div styles={styles.number}>
          {clicks} {text} Donated
        </div>
        <button type='text' onClick={this._onClick.bind(this)} value='Donate a beer'/>
      </div>
    );
  }
}

let ApiData = {
  name: 'ApiData',
  uri: '/api/data',
  data: {
    clicks: 0
  }
};

export default plunge(Index, [ApiData]);
```

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