Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bezrukavyi/lifecycle-connector
Redux connector with react lifecycle events
https://github.com/bezrukavyi/lifecycle-connector
Last synced: 3 days ago
JSON representation
Redux connector with react lifecycle events
- Host: GitHub
- URL: https://github.com/bezrukavyi/lifecycle-connector
- Owner: bezrukavyi
- License: mit
- Created: 2017-10-21T10:20:52.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-04-22T12:50:56.000Z (over 6 years ago)
- Last Synced: 2024-10-29T01:06:38.184Z (17 days ago)
- Language: JavaScript
- Size: 27.3 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
## React-Redux Lifecycle connector
Simple way for integrate react component's [lifecycle](https://reactjs.org/docs/state-and-lifecycle.html) to [redux](https://github.com/reactjs/redux) connector.## Installation
npm install lifecycle-connector --save## Available react lifecycle events
- componentWillMount
- render
- componentDidMount
- componentWillReceiveProps
- shouldComponentUpdate
- componentWillUpdate
- componentDidUpdate
- componentWillUnmount## Usage
In ```container.js``````javascript
import lifecycleConnect from 'lifecycle-connector'
import { reduxForm } from 'redux-form'import Component from './Component'
const mapStateToProps = () => ({
projectsIds: [1, 2, 3],
})const mapDispatchToProps = {
componentDidMount: () => console.log('componentDidMount'),
componentWillMount: () => console.log('componentWillMount'),
}export default lifecycleConnect(mapStateToProps, mapDispatchToProps)(Component)
```## License
The components is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).