Streaming Hillary
This commit is contained in:
parent
466cde06b1
commit
3235956181
7 changed files with 387 additions and 65 deletions
|
@ -4,7 +4,7 @@ import { getHillaryData } from "../actions/index"
|
|||
import { getTrumpData } from "../actions/index"
|
||||
|
||||
export function Post(props) {
|
||||
let { articles, candidate, getHillaryData, getTrumpData } = props
|
||||
let { articles, articlesHillary, candidate, getHillaryData, getTrumpData } = props
|
||||
|
||||
// Fetch tweets when user clicks on candidate's button
|
||||
useEffect(() => {
|
||||
|
@ -29,6 +29,16 @@ export function Post(props) {
|
|||
</li>
|
||||
))}
|
||||
</ul>
|
||||
|
||||
<p>Hillary stream</p>
|
||||
<ul className="list-group list-group-flush">
|
||||
{articlesHillary.map(el => (
|
||||
<li className="list-group-item" key={el.id_str}>
|
||||
<p>{el.created_at}</p>
|
||||
<p>{el.text}</p>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
@ -36,6 +46,7 @@ export function Post(props) {
|
|||
function mapStateToProps(state) {
|
||||
return {
|
||||
articles: state.remoteArticles.slice(0, 10),
|
||||
articlesHillary: state.remoteArticlesHillary.slice(0, 10),
|
||||
candidate: state.candidate
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue