Skip to content

Instantly share code, notes, and snippets.

@eyaleizenberg
Created January 22, 2018 08:36
Show Gist options
  • Save eyaleizenberg/ca909dbaf64af68cbbff5f2dd5f9c54d to your computer and use it in GitHub Desktop.
Save eyaleizenberg/ca909dbaf64af68cbbff5f2dd5f9c54d to your computer and use it in GitHub Desktop.
imdb_list actions
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