# react-recon

> React state management using Context API and Hooks

Latest version **1.0.8** (published 2019-09-04) · ISC license · 0 weekly downloads

## Install

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

## 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.8 |
| Published | 2019-09-04 |
| First published | 2019-06-04 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 493.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Blujedis |
| Maintainers | blujedis |

## Links

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

## Dependencies (2)

- [react](https://npm.io/package/react.md) ^16.9.0
- [react-dom](https://npm.io/package/react-dom.md) ^16.9.0

## Recent versions

- 1.0.8 (latest) — 2019-09-04
- 1.0.7 — 2019-06-07
- 1.0.6 — 2019-06-05
- 1.0.5 — 2019-06-05
- 1.0.3 — 2019-06-05
- 1.0.2 — 2019-06-05
- 1.0.1 — 2019-06-04

## README

# React Recon

Redux like state management using Context API and Hooks.

## Why Use React Recon?

You want the benefits of Redux however you want to utilize the simplicity of Functional Components in React with stateful Hooks.

## Install

```sh
npm install react-recon
```

## Usage 

React Recon is very similar to Redux. Dispatching is identical. Combining reducers and middlware are also, by design the same syntax as Redux. 

```jsx
import React, { useEffect } from 'react';
import { createStore, applyMiddleware, combineReducers } from '../dist';
import { appReducer, userReducer, initialState, logger } from './reducers';

// Apply Middleware //
const middleware = applyMiddleware(logger);

// Combine Reducers //
const reducer = combineReducers({
  app: appReducer,
  user: userReducer
});

// Create Store //
const { Provider, useStore } = createStore(reducer, initialState, middleware);

// Example Component with useStore() //

function Home(props) {

  const [{ user }, dispatch] = useStore();

  useEffect(() => {
    dispatch({ type: 'INCREMENT' });
  }, []); // <-- prevent loop/rerender when state updated.

  return (
    <div>
      <p>
        Hello my name is {user.profile.firstName + ' ' + user.profile.lastName}
      </p>
    </div>
  );

}

// DEFINE PROVIDER //

export default function App() {
  return (
    <Provider>
      <Home />
    </Provider>
  );
};
```

## Docs

See [https://blujedis.github.io/react-recon/](https://blujedis.github.io/react-recon/)

## Change

See [CHANGE.md](CHANGE.md)

## License

See [LICENSE.md](LICENSE)

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