View withEffect
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
type Omit<T, K> = Pick<T, Exclude<keyof T, K>> | |
type Subtract<T, K> = Omit<T, keyof K> | |
export type EffOptions = { | |
ErrorComponent?: React.ComponentType<any> | |
LoadingComponent?: React.ComponentType<any> | |
log?: (...args: any[]) => void | |
} | |
export type EffProps = { |
View hoc.tsx
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 * as React from 'react' | |
import { shallow } from 'enzyme' | |
// --------------------------------------------------------------------------- | |
export type HocProps = { | |
a: boolean | |
b: boolean | |
} |
View effect.tsx
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
// @see: https://gist.github.com/bvaughn/982ab689a41097237f6e9860db7ca8d6 | |
import * as React from 'react' | |
// --------------------------------------------------------------------------- | |
export type EffOptions = { | |
StateComponent?: React.ComponentType<any> | |
} |
View What's going on in JS Land?
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
Cool things folks heard about: | |
* Chrome 65: | |
* Highlights video - https://youtu.be/D1pV7ermy6w | |
* Emberconf | |
* React 16.3 - React.Suspense, React.Context | |
* Everybody hates Redux? | |
* D3 5 | |
View package.json
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
{ | |
"name": "chassis", | |
"version": "0.0.1", | |
"description": "A component library for Blinker", | |
"private": true, | |
"main": "chassis.bundle.js", | |
"scripts": { | |
"build": "./bin/build", | |
"clean": "./bin/clean", | |
"lint": "./node_modules/.bin/eslint src/", |
View webpack.config.js
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 ExtractTextPlugin = require('extract-text-webpack-plugin'); | |
const autoprefixer = require('autoprefixer'); | |
const fs = require('fs'); | |
const path = require('path'); | |
const webpack = require('webpack'); | |
// --------------------------------------------------------------------------- |
View write
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 Router = require('koa-router') | |
const body = require('koa-body') | |
const fs = require('fs') | |
const router = new Router() | |
const BASE_URL = '/upload' | |
router.put(BASE_URL, body({ multipart: true }), async (ctx) => { | |
const files = ctx.request.body.files | |
const keys = Object.keys(files) |
View window.fetch
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
window.fetch('/endpoing', { | |
method: 'POST', | |
body: new window.FormData(file) | |
}) | |
// add something to check for 200 etc. | |
.then(res => res.json()) | |
.then(console.log) | |
.catch(console.error) | |
}) |
View redux-form.js
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
<form onSubmit={ }> | |
<div className="form-group"> | |
<label className="form-check" htmlFor="send-chat"> | |
<Field | |
name="sendChat" | |
id="send-chat" | |
component="input" | |
type="checkbox" | |
onChange={ this.props.handleSubmit(this.props.initialValues, 'sendChat') } | |
/> |
NewerOlder