# @easy-peasy/react

> easy-peasy connector for React

Latest version **0.1.1** (published 2020-01-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install @easy-peasy/react
pnpm add @easy-peasy/react
yarn add @easy-peasy/react
bun add @easy-peasy/react
```

## Health

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

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2020-01-17 |
| First published | 2020-01-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 11 |
| Unpacked size | 84.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Cyriac Béré |
| Maintainers | cyriacbr |
| Keywords | react, redux, state, typescript |

## Links

- npm: https://www.npmjs.com/package/@easy-peasy/react
- Repository: https://github.com/cyriacbr/easy-peasy-packages
- Homepage: https://github.com/CyriacBr/easy-peasy-packages/tree/master/packages/react#readme
- npm.io page: https://npm.io/package/@easy-peasy/react

## Dependencies (11)

- [redux](https://npm.io/package/redux.md) ^4.0.5
- [debounce](https://npm.io/package/debounce.md) ^1.2.0
- [prop-types](https://npm.io/package/prop-types.md) ^15.6.2
- [immer-peasy](https://npm.io/package/immer-peasy.md) 3.1.3
- [redux-thunk](https://npm.io/package/redux-thunk.md) ^2.3.0
- [ts-toolbelt](https://npm.io/package/ts-toolbelt.md) ^6.1.6
- [memoizerific](https://npm.io/package/memoizerific.md) ^1.11.3
- [shallowequal](https://npm.io/package/shallowequal.md) ^1.1.0
- [is-plain-object](https://npm.io/package/is-plain-object.md) ^3.0.0
- [@easy-peasy/core](https://npm.io/package/@easy-peasy/core.md) ^3.2.6
- [symbol-observable](https://npm.io/package/symbol-observable.md) ^1.2.0

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

- 0.1.1 (latest) — 2020-01-17
- 0.1.0 — 2020-01-16

## README

[![Actions Status](https://github.com/CyriacBr/easy-peasy-packages/workflows/build%20%26%20test/badge.svg)](https://github.com/CyriacBr/easy-peasy-packages/actions)

# React Connector

```
npm install @easy-peasy/react
yarn add @easy-peasy/react
```  

## Basic Usage

**Step 1 - Export an existing `easy-peasy` store**

```js
import store from 'some-pkg';
```

**Step 2 - Wrap your application**

```js
import { StoreProvider } from '@easy-peasy/react';

function App() {
  return (
    <StoreProvider store={store}>
      <TodoList />
    </StoreProvider>
  );
}
```

**Step 3 - Use the store**

```js
import { useStoreState, useStoreActions } from '@easy-peasy/react';

function TodoList() {
  const todos = useStoreState(state => state.todos.items)
  const add = useStoreActions(actions => actions.todos.add)
  return (
    <div>
      {todos.map((todo, idx) => <div key={idx}>{todo}</div>)}
      <AddTodo onAdd={add} />
    </div>
  )
}
```

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