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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Page Title</title> | |
<link rel="stylesheet" href="http://localhost:44486/build/css/main.css"> | |
<style> | |
#container { | |
display: flex; | |
flex-direction: column; |
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
version: '3.1' | |
services: | |
wordpress: | |
image: wordpress | |
restart: always | |
ports: | |
- 8080:80 | |
environment: |
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 FETCH_MORE_BRANCHES = 'FETCH_MORE_BRANCHES'; | |
export const SUCCESS_FETCH_BRANCHES = 'SUCCESS_FETCH_BRANCHES'; | |
export function fetchMoreBranches(identityId, nextPage) { | |
return { | |
type: FETCH_MORE_BRANCHES, | |
identityId, | |
nextPage | |
}; | |
} |
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
<Select | |
options={branches} | |
onChange={this.onBranchChange} | |
value={this.state.selectedBranch} | |
onMenuScrollToBottom={() => | |
this.props.fetchMoreBranches(this.props.identityId, this.props.branchesNextPage) | |
} | |
/> |
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
const preloadedState = { | |
repositories: { | |
identityId, | |
branches: [], | |
branchesNextPage: false, | |
} | |
}; | |
let store = createStore(reducers, preloadedState, composeEnhancers(applyMiddleware(epicMiddleware))); |
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
const mapStateToProps = state => ({ branchesNextPage: state.repositories.branchesNextPage }); | |
const mapDispatchToProps = dispatch => ({ | |
fetchMoreBranches: (id, nextPage) => dispatch(fetchMoreBranches(id, nextPage)) | |
}); | |
const AppContainer = connect(mapStateToProps, mapDispatchToProps)(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 React from 'react'; | |
import { SUCCESS_FETCH_BRANCHES } from '../actions'; | |
const repositories = (state = {}, action = []) => { | |
switch (action.type) { | |
case SUCCESS_FETCH_BRANCHES: { | |
return { ...state, branches: state.branches.concat(action.branches), branchesNextPage: action.nextPage }; | |
} | |
default: { |
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 { FETCH_MORE_BRANCHES, successFetchBranches } from '../actions'; | |
import { ofType } from 'redux-observable'; | |
import { EMPTY, of } from 'rxjs'; | |
import { ajax } from 'rxjs/ajax'; | |
import { mergeMap, map, catchError } from 'rxjs/operators'; | |
import tokenHeader from '../../common/helpers/token'; | |
import { showAlertBox } from '../../common/layout'; | |
const fetchLoadMoreBranchesEpic = action$ => { | |
return action$.pipe( |
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
// Container component map dispactch action to the presentational component props | |
const mapDispatchToProps = dispatch => { | |
return { | |
fetchMoreBranches: (identityId, nextPage) => dispatch(fetchMoreBranches(identityId, nextPage)) | |
}; | |
}; | |
const AppContainer = connect(mapStateToProps, mapDispatchToProps)(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
<Select | |
options={branches} | |
onChange={this.onBranchChange} | |
value={this.state.selectedBranch} | |
onMenuScrollToBottom={() => { | |
if (this.props.branchesNextPage !== false) { | |
this.props.fetchMoreBranches(this.props.identityId, this.props.branchesNextPage); | |
} | |
}} | |
/> |
NewerOlder