-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from patrickml/development
Release 0.0.2
- Loading branch information
Showing
44 changed files
with
834 additions
and
1,764 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
import './map.actions'; | ||
import './modal.actions'; | ||
import './menu.actions'; | ||
import './timer.actions'; | ||
import './location.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import EventHorizon from 'react-native-event-horizon'; | ||
|
||
EventHorizon.createAction('location', 'UPDATE_LOCATION', (store, location, update) => { | ||
update({ | ||
latitude: location.latitude, | ||
longitude: location.longitude, | ||
}); | ||
}); | ||
|
||
export default (region) => EventHorizon.dispatch('UPDATE_LOCATION', region); |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,16 @@ | ||
import EventHorizon from 'react-native-event-horizon'; | ||
import fetchPokemon from '../fetch'; | ||
|
||
EventHorizon.createAction('menu', 'TRIGGER_OPEN_MENU', (store, open, update) => { | ||
console.log('MENU', open); | ||
if (store.open !== open) { | ||
update({ open }); | ||
} | ||
}); | ||
|
||
EventHorizon.createAction('menu', 'TOGGLE_OPEN_MENU', (store, data, update) => { | ||
update({ open: !store.open }); | ||
}); | ||
|
||
export const openMenu = () => EventHorizon.dispatch('TRIGGER_OPEN_MENU', true); | ||
export const closeMenu = () => EventHorizon.dispatch('TRIGGER_OPEN_MENU', false); | ||
export const setMenuState = (open) => EventHorizon.dispatch('TRIGGER_OPEN_MENU', open); | ||
export const toggleMenu = () => EventHorizon.dispatch('TOGGLE_OPEN_MENU'); |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import EventHorizon from 'react-native-event-horizon'; | ||
import defaultStore from '../stores/timer.store'; | ||
|
||
// create a timer variable so we can set and reset it | ||
let timer = null; | ||
|
||
export const startTimer = () => EventHorizon.dispatch('TIMER_START'); | ||
export const resetTimer = () => EventHorizon.dispatch('TIMER_RESET'); | ||
export const decrementTimer = () => EventHorizon.dispatch('TIMER_DECREMENT'); | ||
|
||
EventHorizon.createAction('timer', 'TIMER_RESET', (store, data, update) => { | ||
update(defaultStore); | ||
}); | ||
|
||
EventHorizon.createAction('timer', 'TIMER_START', (store, data, update) => { | ||
update({ | ||
time: 30, | ||
}); | ||
// set the timer to an interval of 1 second to decrement the store | ||
timer = setInterval(() => decrementTimer(), 1000); | ||
}); | ||
|
||
EventHorizon.createAction('timer', 'TIMER_DECREMENT', (store, data, update) => { | ||
if (store.time > 0) { | ||
update({ | ||
time: store.time - 1, | ||
}); | ||
} else if (timer) { | ||
// clear the interval if the value is 0 | ||
clearInterval(timer); | ||
} | ||
}); |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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
Oops, something went wrong.