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 machine = Machine( | |
{ | |
id: 'call', | |
context: { | |
participants: [], | |
color: '#fff', | |
}, | |
initial: 'idle', | |
states: { | |
idle: { |
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 door = Machine({ | |
id: 'door', | |
initial: 'idle', | |
states: { | |
idle: { | |
context: { | |
participants: [], | |
}, |
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
/** | |
* Credit: https://medium.com/@alfianlosari/graphql-cursor-infinite-scroll-pagination-with-react-apollo-client-and-github-api-fafbc510b667 | |
* This component will call the onLoadMore prop when you scroll to the bottom of the page or click | |
* the button, and pass the fetched data to the component you give it | |
* */ | |
import React, { Component, Fragment } from 'react'; | |
import PropTypes from 'prop-types'; | |
class InfiniteScroll extends Component { |
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
// src/containers/RepoSearchPage/reducer/RepoSearchReducer.js | |
import { actionTypes } from '../RepoSearchConstants'; | |
const initialState = { | |
results: [], | |
error: '' | |
}; | |
export default (state = initialState, action) => { |
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
// src/containers/RepoSearchPage/reducer/RepoSearchReducer.spec.js | |
import RepoSearchReducer from './RepoSearchReducer'; | |
import { actionTypes } from '../RepoSearchConstants'; | |
const initialState = { | |
results: [], | |
error: '', | |
}; |
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
// src/containers/RepoSearchPage/actions/RepoSearchActions.js | |
import searchService from '../../../services/search/searchService'; | |
import { actionTypes } from '../RepoSearchConstants'; | |
export const fetchRepos = () => async (dispatch) => { | |
let error = ''; | |
try { | |
const { items } = await searchService.repoSearch(); | |
dispatch({ |
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
// src/containers/RepoSearchPage/actions/RepoSearchActions.spec.js | |
import { fetchRepos } from './RepoSearchActions'; | |
import searchService from '../../../services/search/searchService'; | |
import { actionTypes } from '../RepoSearchConstants'; | |
jest.mock('../../../services/search/searchService'); | |
describe('repo search actions', () => { | |
describe('fetchRepos', () => { |
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
// src/containers/RepoSearchPage/page/RepoSearchPage.js | |
import React, { Component } from 'react'; | |
import PropTypes from 'prop-types'; | |
import { connect } from 'react-redux'; | |
import { bindActionCreators } from 'redux'; | |
import RepoResultsList from '../components/RepoResultsList/RepoResultsList'; | |
import * as RepoSearchActions from '../actions/RepoSearchActions'; | |
export class RepoSearchPage extends Component { |
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
// src/containers/RepoSearchPage/page/RepoSearchPage.js | |
import React, { Component } from 'react'; | |
import PropTypes from 'prop-types'; | |
import { connect } from 'react-redux'; | |
import { bindActionCreators } from 'redux'; | |
import RepoResultsList from '../components/RepoResultsList/RepoResultsList'; | |
import * as RepoSearchActions from '../actions/RepoSearchActions'; | |
export class RepoSearchPage extends Component { |
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
// src/containers/RepoSearchPage/page/RepoSearchPage.js | |
// export the class to test in isolation | |
export class RepoSearchPage extends Component { | |
constructor(props) { | |
super(props); | |
} | |
... | |
NewerOlder