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
{ | |
"Ansi 3 Color" : { | |
"Red Component" : 1, | |
"Color Space" : "sRGB", | |
"Blue Component" : 0.38039215686274508, | |
"Alpha Component" : 1, | |
"Green Component" : 0.88627450980392153 | |
}, | |
"Tags" : [ |
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 multiPitchMachine = Machine({ | |
id: 'multi-pitch', | |
initial: 'idle', | |
context: { | |
pitches: 0 | |
}, | |
states: { | |
idle: { | |
on: { |
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 MyContext = createContext(); | |
function reducer(state, action) { | |
switch (action.type) { | |
case "COUNT_REQUEST": | |
return { | |
...state, | |
loading: true, | |
err: undefined | |
}; |
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 DEFAULT = { | |
data: [], | |
isLoading: false | |
} | |
const { Provider, Consumer } = React.createContext({ ...DEFAULT }); | |
class HttpProvider extends Component { | |
state = { ...DEFAULT }; |
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
class HttpProvider extends Component { | |
state = { | |
isLoading: false, | |
data: [] | |
} | |
// Fetch initial data on mount | |
async componentDidMount() { | |
await this.updateData(); | |
} | |
// HOF for adding loading to async function |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<title>Plain Jane React App</title> | |
</head> | |
<body> |