I hereby claim:
- I am kevinwucodes on github.
- I am kevinwu (https://keybase.io/kevinwu) on keybase.
- I have a public key whose fingerprint is 5901 231A 16D9 AA4B A9A4 1EE1 6826 2134 727D 8CB1
To claim this, I am signing this object:
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="content-type" content="text/html; charset=UTF-8" /> | |
<title>Google Maps Multiple Markers</title> | |
<SCRIPT TYPE="text/javascript" src="https://code.jquery.com/jquery-2.1.1.min.js"></SCRIPT> | |
<SCRIPT TYPE="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.6.0/underscore-min.js"></SCRIPT> |
<html> | |
<head> | |
<title>FormData file test</title> | |
<SCRIPT TYPE="text/javascript" src="https://code.jquery.com/jquery-2.1.1.min.js"></SCRIPT> | |
</head> | |
<body> | |
<input id="filebutton" type='file' /> |
I hereby claim:
To claim this, I am signing this object:
const prom = () => new Promise((resolve, reject) => { | |
setTimeout(() => { | |
reject('got rejected') | |
}, 2000) | |
}) | |
const foo = async () => { | |
try { | |
console.log('good', await prom()) | |
} catch(err) { |
//http://www.webpackbin.com/NkMEv-_7M | |
import React from 'react'; | |
import {render} from 'react-dom'; | |
import HelloWorld from './HelloWorld.js'; | |
const divContainer = document.querySelector('#app') | |
const obj1 = { | |
first: 'kevin' |
Verifying that "kevinwu.id" is my Blockstack ID. https://onename.com/kevinwu |
### Keybase proof | |
I hereby claim: | |
* I am kevinwucodes on github. | |
* I am kevinwu (https://keybase.io/kevinwu) on keybase. | |
* I have a public key whose fingerprint is 1CD7 0CF4 B2B2 787F A3A0 93FF 9EE9 8632 FCFC AA9D | |
To claim this, I am signing this object: |
Koa middleware cascade in a more traditional way as you may be used to with similar tools - this was previously difficult to make user friendly with node's use of callbacks. However with async functions we can achieve "true" middleware. Contrasting Connect's implementation which simply passes control through series of functions until one returns, Koa invoke "downstream", then control flows back "upstream".
The following example responds with "Hello World", however first the request flows through the x-response-time and logging middleware to mark when the request started, then continue to yield control through the response middleware. When a middleware invokes next() the function suspends and passes control to the next middleware defined. After there are no more middleware to execute downstream, the stack will unwind and each middleware is resumed to perform its upstream behaviour.
const Koa = require('koa');
const app = new Koa();
Eric Elliott had an interesting tweet that intrigued me: https://twitter.com/_ericelliott/status/912407669683609600?s=03
Here's what he posted:
const map = transform => reducer => ((acc, current) => reducer(acc, transform(current)))
const filter = predicate => reducer => (
(acc, current) => predicate(current) ? reducer(acc, current) : acc
)
inspired by: http://blog.revathskumar.com/2016/02/reactjs-using-debounce-in-react-components.html
class Test extends React.Component {
constructor(props) {
super(props)