Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import React, { Component } from 'react'
- import { connect } from 'react-redux'
- import actions from '../../actions'
- class Feeds extends Component{
- componentDidMount(){
- this.props.fetchFeeds(null)
- }
- render(){
- return(
- <ul>
- {
- this.props.feed.all.map((feed, i)=>{
- return (
- <li key={i}><a href="#">{feed.name}</a></li>
- )
- })
- }
- </ul>
- )
- }
- }
- const stateToProps = (state) => {
- return {
- feed: state.feed
- }
- }
- const dispatchToProps = (dispatch) => {
- return {
- fetchFeeds: (params) => dispatch(actions.fetchFeeds(params))
- }
- }
- export default connect(stateToProps, dispatchToProps)(Feeds)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement