# redux-dispatch-hooks

> shortcut hooks for creating redux actions

Latest version **1.0.4** (published 2020-03-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install redux-dispatch-hooks
pnpm add redux-dispatch-hooks
yarn add redux-dispatch-hooks
bun add redux-dispatch-hooks
```

## Health

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

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2020-03-01 |
| First published | 2020-02-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 14.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | vaukalak |
| Maintainers | vaukalak |

## Links

- npm: https://www.npmjs.com/package/redux-dispatch-hooks
- Repository: https://github.com/vaukalak/redux-dispatch-hooks
- npm.io page: https://npm.io/package/redux-dispatch-hooks

## Dependencies (1)

- [react-use-handler](https://npm.io/package/react-use-handler.md) ^1.2.0

## Recent versions

- 1.0.4 (latest) — 2020-03-01
- 1.0.3 — 2020-02-26
- 1.0.2 — 2020-02-09
- 1.0.1 — 2020-02-08

## README

# redux-dispatch-hooks

Developer friendly dispatch hooks. Brings `mapDispatchToProps` like experience.

## Installation

```
npm i -S redux-dispatch-hooks
```

## Setup

If you're using `react-redux`, you can just wrap your app with `react-redux` `Provider` and it will work. Otherwise you can use `Provider` from this lib:

```
import React from 'react';
import { Provider } from 'redux-dispatch-hooks';
import { createStore } from 'redux';
import { RootComponent } from './your-root-component-path'

const store = createStore(...);

export const App = () => (
  <Provider store={store}>
    <RootComponent>
  </Provider>
);

```

## Usage

```
import React from "react";
import { useDispatchMap } = from "redux-dispatch-hooks";
import * as actions from "./actions";

const Comment = ({
  onRemove,
  onShare,
}) => {
  return (
    <div>
      SOME COMMENT
      <div onClick={onRemove}>REMOVE</div>
      <div onClick={onShare}>SHARE</div>
    </div>
  )
};

const CommentContainer = () => {
  const dispatchMap = useDispatchMap({
    onRemove
    onShare
  });
  return (
    <Comment
      {...dispatchMap}
    />
  );
}
```

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