Created
January 22, 2018 08:36
-
-
Save eyaleizenberg/ca909dbaf64af68cbbff5f2dd5f9c54d to your computer and use it in GitHub Desktop.
imdb_list actions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as imdb from 'imdb-api'; | |
import { actions } from '../redux/reducers'; | |
const showId = 'tt4574334'; | |
const apiKey = 'your_omdb_api_key_goes_here'; | |
export const fetchStrangerThings = () => (dispatch) => { | |
imdb.getById(showId, { apiKey }).then(results => { | |
results.episodes().then(episodes => { | |
dispatch(actions.concatEpisodesData(episodes)); | |
}) | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment