Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tanhauhau/inducer
Inject redux reducer with HOC
https://github.com/tanhauhau/inducer
hoc react react-redux reducer redux
Last synced: 2 months ago
JSON representation
Inject redux reducer with HOC
- Host: GitHub
- URL: https://github.com/tanhauhau/inducer
- Owner: tanhauhau
- License: mit
- Created: 2017-11-03T06:40:58.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2017-11-03T08:19:58.000Z (about 7 years ago)
- Last Synced: 2024-10-13T14:10:20.534Z (2 months ago)
- Topics: hoc, react, react-redux, reducer, redux
- Language: JavaScript
- Size: 35.2 KB
- Stars: 5
- Watchers: 2
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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 (
)
}
```