Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/tanhauhau/inducer

Inject redux reducer with HOC
https://github.com/tanhauhau/inducer

hoc react react-redux reducer redux

Last synced: 21 days ago
JSON representation

Inject redux reducer with HOC

Awesome Lists containing this project

README

        

# Inducer

[![Build Status](https://travis-ci.org/tanhauhau/inducer.svg?branch=master)](https://travis-ci.org/tanhauhau/inducer)
[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/tanhauhau/inducer/blob/master/LICENSE)
![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)

## Inject Redux Reducer in a HOC way!

### Install

```bash
$ yarn add inducer
```

### Show me how!

```js
// YourComponent.js
import gameReducer from './gameReducer';
import injectReducer from 'inducer';

class YourComponent extends React.Component {
// component logic here
}
export default injectReducer({
game: gameReducer
})(YourComponent);
```

```js
// App.js
import React from 'react';
import { Provider } from 'react-redux';
import YourComponent from './YourComponent.js'

export default function App({ store }) {
return (




)
}
```