# wc-context-redux

> Used to decouple elements (like MyComponent below) from the store, so they can be used with any store

Latest version **1.1.2** (published 2020-02-07) · BSD-3-Clause license · 0 weekly downloads

## Install

```sh
npm install wc-context-redux
pnpm add wc-context-redux
yarn add wc-context-redux
bun add wc-context-redux
```

## 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.1.2 |
| Published | 2020-02-07 |
| First published | 2019-06-24 |
| Weekly downloads | 0 |
| License | BSD-3-Clause |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 9.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | srijken |

## Links

- npm: https://www.npmjs.com/package/wc-context-redux
- npm.io page: https://npm.io/package/wc-context-redux

## Dependencies (2)

- [redux](https://npm.io/package/redux.md) ^4.0.1
- [@polymer/polymer](https://npm.io/package/@polymer/polymer.md) ^3.2.0

## Recent versions

- 1.1.2 (latest) — 2020-02-07
- 1.1.1 — 2020-02-07
- 1.1.0 — 2020-02-07
- 1.0.0 — 2019-06-24

## README

# wc-context-redux
Used to decouple elements (like MyComponent below) from the store, so they can be used with any store

# Usage

## Store provider
```js
import { html, LitElement } from 'lit-element';
import { connect } from 'pwa-helpers/connect-mixin.js';
import { store } from '../store.js';
import 'wc-context-redux/store-context';

class MyParentClass extends connect(store)(LitElement) {
    render() {
        return html`
            <store-provider .value=${store}>
                <my-app .compositionId="${this.id}"></my-app>
            </store-provider>
        `;
    }
}
```

## Components
```js
import connect from 'wc-context-redux/connect';

const mapStateToProps = state => ({
    componentProp = state.stateProp
});
  
const mapDispatchToProps = dispatch => ({
    componentMethod: (theParam) => dispatch(actionCreator(theParam))
});

class MyComponent extends connect(mapStateToProps, mapDispatchToProps)(LitElement) {
   ...
}

```

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