# ts-redux-connect

> This is a lightweight implementation for typesafe use of the great library react-redux `connect()`.

Latest version **1.1.4** (published 2019-06-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install ts-redux-connect
pnpm add ts-redux-connect
yarn add ts-redux-connect
bun add ts-redux-connect
```

## 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.1.4 |
| Published | 2019-06-01 |
| First published | 2019-05-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 2.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | wakhtn |
| Maintainers | wakhtn |
| Keywords | redux, typescript, connect, ts, react |

## Links

- npm: https://www.npmjs.com/package/ts-redux-connect
- Repository: https://github.com/wakhtn/ts-redux-connect
- npm.io page: https://npm.io/package/ts-redux-connect

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

- 1.1.4 (latest) — 2019-06-01
- 1.1.3 — 2019-05-26
- 1.1.2 — 2019-05-24
- 1.1.1 — 2019-05-24
- 1.1.0 — 2019-05-24
- 1.0.8 — 2019-05-22
- 1.0.7 — 2019-05-22
- 1.0.6 — 2019-05-22
- 1.0.5 — 2019-05-22
- 1.0.4 — 2019-05-22
- 1.0.3 — 2019-05-22
- 1.0.2 — 2019-05-22
- 1.0.1 — 2019-05-19
- 1.0.0 — 2019-05-19

## README

ts-redux-connect
====

Overview

## Description
This is a lightweight implementation for typesafe use of the great library react-redux `connect()`. 

## Usage

Define your store using reduxt `createStore()`, and create function `connect()` using ts-redux-connect.
```
// store.ts
import createConnect from 'ts-redux-connect';

const initialState = {
  name: "",
  age: 2
}

// reducer
const reducer = (state = initialState, action) => {
  return state;
}

// store
const store = createStore(reducer);

export type stateType = typeof initialState;
export const connect = createConnect<stateType>();

```
use `connect()` that was created in `store.ts`;

```
// component.ts
import {connect} from './store'

interface ComponentProps {
  name: string
}

const MyComponent = (props: ComponentProps) => {
  return <div> {props.name} </div>
}

export default connect<ComponentProps>((state,dispatch)=>{
  return {
    name: state.name
  }
})(MyComponent)

```

## Install
```
$ npm install -S ts-redux-connect
or
$ yarn add ts-redux-connect
```

## Author

[wakhtn](https://github.com/wakhtn)
MIT

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