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
dfds-kd:bench-app kdichev$ yarn run build | |
yarn run v1.17.3 | |
$ gatsby build | |
success open and validate gatsby-configs - 0.038s | |
success load plugins - 0.682s | |
Loaded gatsby-source-contentful | |
Loaded gatsby-starter-plugin | |
success onPreInit - 0.022s | |
success delete html and css files from previous builds - 0.733s | |
success initialize cache - 0.019s |
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
2020-03-17T08:26:02.8640112Z yarn run v1.19.1 | |
2020-03-17T08:26:02.9055760Z $ yarn validate:schema | |
2020-03-17T08:26:03.1232878Z $ node ./scripts/validate-local-schema.js | |
2020-03-17T08:26:03.3995455Z $ gatsby build | |
2020-03-17T08:26:04.7039219Z success open and validate gatsby-configs - 0.076s | |
2020-03-17T08:26:05.4198376Z success load plugins - 0.702s | |
2020-03-17T08:26:05.4353014Z success onPreInit - 0.004s | |
2020-03-17T08:26:05.4545610Z success delete html and css files from previous builds - 0.009s | |
2020-03-17T08:26:05.4693152Z success initialize cache - 0.005s | |
2020-03-17T08:26:05.5002112Z success copy gatsby files - 0.022s |
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
// bad | |
<div | |
className={`miniBook__tab miniBook__tabOneWay${oneWay ? ' miniBook__tab--active' : ''}`} | |
onClick={() => this.tabOnClick(oneWay)} | |
> | |
{children} | |
</div> | |
// better | |
<div |
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
// that needs to become something readable for a pathfinding algorithm like | |
// [ | |
// [0, 0, 0, 1, 0], | |
// [1, 0, 0, 0, 1], | |
// [0, 0, 1, 0, 0], | |
// ] | |
const apiData = [ | |
[ | |
"west", |
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
// data contains width * height walkable path entries | |
// each entry has at most two walls "west" | "north" | |
// to find all walkable directions from X use the array entries X, X+1 and X+width to construct walls | |
// grid is 15x15 blocks | |
const data = [["west","north"],["north"],["west","north"],["north"],["north"],["west","north"],["north"],["north"],["west","north"],["north"],["north"],["north"],["west","north"],["north"],["north"],["west","north"],["west"],["west"],["north"],["west"],["west"],["west"],["west"],["north"],["north"],[],["west"],["north"],["north"],[],["west"],[],["west"],["west"],["north"],[],["west"],["north"],["north"],["west","north"],["north"],[],["west","north"],["north"],["west"],["west"],["north"],["north"],["west"],["north"],["north"],["north"],["north"],["west"],["north"],["north"],["north"],["west"],["west"],["west"],["west","north"],["north"],["west"],["west"],["west","north"],["north"],["north"],["west"],["west","north"],["north"],["west"],["west"],[],["west"],["north"],["west"],["west |
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 data = [ | |
[ | |
'west', | |
'north' | |
], | |
[ | |
'north' | |
], | |
[ | |
'north' |
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
mutation { | |
createCar( | |
name: "car" | |
carBrand: "Mercedes-Benz" | |
carMode: "C63 AMG" | |
carYear: "2018-06-19T19:51:13.701Z" | |
) { | |
id | |
carBrand | |
} |
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 asyncAction = (dataMaybe) => async (dispatch, getState) => { | |
// u can dispatch all kinds of actions here according to outcome | |
dispatch({type: "FETCHING_START"} | |
// if u need to use store data but can be passed as arg from react component when invoking | |
const store = getState().theReducer | |
const response = await myFetchFunction() | |
if (response) { | |
dispatch({type: "FETCHING_SUCCESS", payload: {response}} |
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 { connect } from "react-redux"; | |
const mapStateToProps = ({ | |
theReducer: { city, humidity, temperature, wind } | |
}) => ({ | |
city, | |
humidity, | |
temperature, | |
wind | |
}); |
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 { combineReducers } from "redux"; | |
const initialState = { | |
hi: "hi" | |
}; | |
export const theReducer = (state = initialState, action) => { | |
switch (action.type) { | |
case "SOMETHING_HAPPENING": | |
return { ...state, hi: "bye" }; |
NewerOlder