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
{ | |
"singleQuote": true, | |
"trailingComma": "all", | |
"useTabs": true, | |
"tabWidth": 4, | |
"printWidth": 100 | |
} |
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
.container-layout { | |
min-height: 60px; | |
max-width: 600px; | |
margin: auto; | |
padding: 0 5px; | |
} | |
.container-flex { | |
display: flex; | |
justify-content: space-between; |
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
export const createContext = value => { | |
const context = reactCreateContext(value); | |
export const withContext = Component => { | |
const C = props => ( | |
<context.Consumer> | |
{context => <Component {...context} {...props} />} | |
</context.Consumer> | |
); |
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 ... | |
import { SmolComponent } from './SmolComponent'; | |
export class BigOleComponent { } |
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 React, { Component } from 'react'; | |
import fetch from 'unfetch' | |
class FetchAsync extends Component { | |
constructor(props) { | |
super(props); | |
this.state = { isFetching: false }; | |
} | |
async fetch = () => { |
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 compose = (...fns) => x => [...fns].reverse().reduce((acc, fn) => fn(acc), x); | |
const compose = (...fns) => { | |
const [first, ...rest] = [...fns].reverse(); | |
return (...args) => rest.reduce((acc, fn) => fn(acc), first(...args)); | |
} |
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'; | |
import * as selectors from '../selectors'; | |
const fnNameFor = ([first, ...rest]) => (`get${first.toUpperCase()}${rest.join('')}`); | |
const selectFor = key => selectors[fnNameFor(key)]; | |
const getMapStateFor = stateKeys => state => stateKeys.reduce( | |
(acc, key) => ({ ...acc, [key]: selectFor(key)(state) }), | |
{}, |
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
// Settings | |
{ | |
"breadcrumbs.enabled": false, | |
"editor.fontFamily": "FiraCode-Retina, FiraCode-Retina", // Need to download this font | |
"editor.fontLigatures": true, | |
"editor.insertSpaces": false, | |
"editor.renderWhitespace": "all", | |
"editor.wordWrap": "off", | |
"explorer.confirmDelete": false, | |
"explorer.enableDragAndDrop": false, |
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 spicify = ([first, ...rest]) => [...rest].reduce((acc, i) => `${acc} ${i.toUpperCase()}`, first.toUpperCase()); | |
spicify('spicey'); |
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
// Still not sure why object spread is not full spec... | |
const spread = (...objs) => Object.assign({}, ...objs); | |
const safeSpread = (...objs) => Object.assign({}, ...objs.map(o => o || {})); |