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 SingleRule = new GraphQLObjectType({ | |
name: 'SingleRule', | |
description: 'Single validation rule', | |
fields: () => ({ | |
id: { | |
type: GraphQLID, | |
description: 'ID of rule' | |
}, | |
fieldName: { | |
type: GraphQLString, |
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, { Component } from 'react' | |
import { BootstrapTable, TableHeaderColumn } from 'react-bootstrap-table' | |
import '../node_modules/react-bootstrap-table/dist/react-bootstrap-table-all.min.css' | |
const data = [ | |
{ | |
id: 0, | |
name: 'Oleg', | |
yearBorn: 1988, | |
}, |
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 { FetchDropdownData, FetchUsers, FetchProposals } from './Fetchers' | |
import ProposalsView from './ProposalsView' | |
export default () => ( | |
<FetchDropdownData> | |
<FetchUsers> | |
<FetchProposals> | |
<ProposalsView /> | |
</FetchProposals> | |
</FetchUsers> |
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 newProps = { ...rest } | |
if (mapFetchedDataTo) { | |
delete newProps.data | |
newProps[mapFetchedDataTo] = this.props.data | |
} | |
const chidlrenWithProps = cloneElement(children, newProps) | |
const dataValidationErrors = this.getRequiredDataErrors() |
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
// reducer | |
initialState = { | |
isFetching: false, | |
error, | |
programs | |
} | |
// ProgramsController | |
import Loadable from './Loadable' |
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
class LoadableContainer extends Component { | |
componentDidMount() { | |
const { fetchData, data } = this.props | |
if (!data) { | |
fetchData() | |
} | |
} | |
render() { | |
const { children, isFetching, error, fetchData, ...rest } = this.props |
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, { Component, Children } from 'react' | |
import { connect } from 'react-redux' | |
import PropTypes from 'prop-types' | |
import { fetchPrograms } from '../../modules/loanPrograms' | |
class LoanProgramContainer extends Component { | |
componentDidMount() { | |
this.props.fetchPrograms() | |
} |
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
var container = { | |
context: [], | |
canvas: [], | |
gameArea: null, | |
width: 0, | |
height: 0, | |
unitSize: 0, | |
init: function () { |
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
function findMaxZerosFrom(arr, index) { | |
let zerosLength = 1 | |
let nextElement = arr[index + 1] | |
while(nextElement === '0') { | |
index++ | |
zerosLength++ | |
nextElement = arr[index + 1] | |
} |
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
function patchStoreToAddLogging(store) { | |
let next = store.dispatch | |
store.dispatch = function dispatchAndLog(action) { | |
console.log('dispatching', action) | |
let result = next(action) | |
console.log('next state', store.getState()) | |
return result | |
} | |
} |