From 89bb3d4563a1c1a74ccbbe1dc85514411596dfcc Mon Sep 17 00:00:00 2001 From: Matthieu Napoli Date: Mon, 13 Aug 2018 17:04:02 +0200 Subject: [PATCH] Add selector example --- App/Containers/HomeScreen.js | 3 +++ App/Stores/Example/Selectors.js | 11 +++++++++++ 2 files changed, 14 insertions(+) create mode 100644 App/Stores/Example/Selectors.js diff --git a/App/Containers/HomeScreen.js b/App/Containers/HomeScreen.js index 74131a4e4..737d6b7f3 100644 --- a/App/Containers/HomeScreen.js +++ b/App/Containers/HomeScreen.js @@ -3,6 +3,7 @@ import { Platform, StyleSheet, Text, View, Button } from 'react-native' import { connect } from 'react-redux' import { PropTypes } from 'prop-types' import ExampleActions from 'App/Stores/Example/Actions' +import { isHot } from 'App/Stores/Example/Selectors' const instructions = Platform.select({ ios: 'Press Cmd+R to reload,\n' + 'Cmd+D or shake for dev menu', @@ -23,6 +24,7 @@ class HomeScreen extends React.Component { The weather temperature is: {this.props.temperature} + {this.props.isHot ? "It's pretty hot!" : ''} {this.props.errorMessage}