Skip to content

Commit 2574787

Browse files
author
woi
committed
modify selector to use user data
1 parent 27a5a0d commit 2574787

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

App/Stores/Example/Selectors.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@
66
* Writing selectors is optional as it is not always necessary, we provide a simple example below.
77
*/
88

9-
export const isHot = (state) => {
10-
return state.example.get('temperature') && state.example.get('temperature') > 25
9+
export const liveInEurope = (state) => {
10+
if (!state.example.get('user')) return null
11+
12+
// For this example, we imagine this cities are european cities
13+
let europeanCities = ['Gwenborough', 'Wisokyburgh', 'McKenziehaven', 'South Elvis', 'Roscoeview']
14+
15+
return europeanCities.includes(state.example.get('user').toJS().address.city)
1116
}

0 commit comments

Comments
 (0)