This file contains hidden or 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
| const privateActionCreators = { | |
| getMatchesSuccess: matchList => ({ | |
| type: actions.GET_MATCHES_SUCCESS, | |
| payload: matchList, | |
| target: 'matches' | |
| }), | |
| getMatchesError: error => ({ | |
| type: actions.GET_MATCHES_ERROR, | |
| payload: error, | |
| target: 'matches' |
This file contains hidden or 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
| function createReducer(initialState, reducerObject) { | |
| return (state = initialState, action) => ( | |
| (reducerObject[action.type] && reducerObject[action.type](state, action)) || state; | |
| ); | |
| } | |
| export default createReducer(initialState, reducerDescription); |
This file contains hidden or 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
| const reducerDescription = { | |
| [actions.GET_MATCHES]: (state, action) => ({ ...state, matchesLoading: true }), | |
| [actions.GET_MATCHES_SUCCESS]: (state, action) => ({ | |
| ...state, | |
| matchesLoading: false, | |
| matchesError: null, | |
| matches: action.payload | |
| }), | |
| [actions.GET_MATCHES_FAILURE]: (state, action) => ({ | |
| ...state, |
This file contains hidden or 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 { actions } from './actions'; | |
| const initialState = { | |
| matches: [], | |
| matchesLoading: false, | |
| matchesError: null, | |
| pitches: [], | |
| pitchesLoading: false, | |
| pitchesError: null | |
| }; |
This file contains hidden or 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 SoccerService from '../services/SoccerService'; | |
| export const actions = createTypes([ | |
| 'GET_MATCHES', | |
| 'GET_MATCHES_SUCCESS', | |
| 'GET_MATCHES_FAILURE', | |
| 'GET_PITCHES', | |
| 'GET_PITCHES_SUCCESS', | |
| 'GET_PITCHES_FAILURE' | |
| ], '@SOCCER'); |
This file contains hidden or 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
| #!/usr/bin/python3 | |
| import sys | |
| from time import time | |
| from math import sqrt | |
| from random import uniform | |
| UP = 0 | |
| RIGHT = 1 | |
| DOWN = 2 |
This file contains hidden or 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 createLine = (dist, angle, color, opacity, startingPoint) => { | |
| return { | |
| backgroundColor: color, | |
| height: 4, | |
| width: dist, | |
| bottom: dist * Math.sin(angle) / 2 + startingPoint.y, | |
| left: -dist * (1 - Math.cos(angle)) / 2 + startingPoint.x, | |
| position: 'absolute', | |
| opacity, | |
| transform: [ |
This file contains hidden or 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 createPoint = (coordinates, color, size = 8) => { | |
| return { | |
| backgroundColor: color, | |
| left: coordinates.x - 3, | |
| bottom: coordinates.y - 2, | |
| position: 'absolute', | |
| borderRadius: 50, | |
| width: size, | |
| height: size | |
| }; |
This file contains hidden or 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 React, { Component } from 'react'; | |
| import { | |
| AppRegistry, | |
| StyleSheet, | |
| Text, | |
| View | |
| } from 'react-native'; | |
| import SeparatorsLayer from './SeparatorsLayer'; | |
| import PointsPath from './PointsPath'; |
This file contains hidden or 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 SeparatorsLayer from './SeparatorsLayer'; | |
| import PointsPath from './PointsPath'; | |
| import { Point } from './pointUtils'; | |
| import { startingPoint, vectorTransform } from './Scaler'; | |
| const lightBlue = '#40C4FE'; | |
| const green = '#53E69D'; | |
| const lightBluePoints = [Point(0, 0), Point(1, 2), Point(2, 3), Point(3, 6), Point(5, 6)]; | |
| const greenPoints = [Point(0, 2), Point(3, 4), Point(4, 0), Point(5, 10)]; |