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
export const getEpisodesDataLength = (state) => state.superReducer.episodes.data.length; |
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 React from 'react'; | |
import { connect } from 'react-redux' | |
import App from '../components/App/App'; | |
import { selectors, actions } from '../redux/reducers'; | |
import { fetchStrangerThings } from '../actions/episodesActions'; | |
import PropTypes from 'prop-types'; | |
export class AppContainer extends React.PureComponent { | |
static propTypes = { | |
showInfoVisible: PropTypes.bool.isRequired, |
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)); |
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 { connect } from 'react-redux' | |
import { selectors, actions } from '../redux/reducers'; | |
import App from '../components/App/App'; | |
const mapStateToProps = (state) => ({ | |
showInfoVisible: selectors.getShowInfoVisible(state) | |
}); | |
const { toggleShowInfoVisible } = 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 { connect } from 'react-redux' | |
import { selectors } from '../redux/reducers'; | |
import App from '../components/App/App'; | |
const mapStateToProps = (state) => ({ | |
showInfoVisible: selectors.getShowInfoVisible(state) | |
}); | |
export default connect(mapStateToProps)(App); |
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 { combineReducers } from 'redux'; | |
import reduxCornell from 'redux-cornell'; | |
const { selectors, actions, superReducer } = reduxCornell({ | |
initialState: { | |
episodes: { | |
loaded: false, | |
data: [], | |
expanded: {} | |
}, |
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
'use strict' | |
React = require('react-native') | |
NavigationBarRouteMapper = require('../modules/navigation_bar_route_mapper') | |
_ = require('lodash') | |
pages = | |
Incidents: Incidents | |
Notifications: Notifications |
NewerOlder