import until from 'path/to/until'
import { shallow } from 'enzyme'
const EnhancedFoo = compose(
connect(...),
withHandlers(...),
withContext(...)
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
// Make it Nasty | |
function increment (i) { | |
i ^= (i & ~-~i) | (~i & -~i) | |
return i | |
} |
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
angular | |
.module('asyncFilter', []) | |
.filter('async', function() { | |
const values = {}; | |
const subscriptions = {}; | |
function async(input, scope) { | |
// Make sure we have an Observable or a Promise | |
if (!input || !(input.subscribe || input.then)) { | |
return input; |
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
// install @types/react-redux and other nonsense | |
import * as React from 'react' | |
import { connect } from 'react-redux' | |
import { YourActualAppState } from './wherever-it-is.ts' | |
export function mapStateToProps({ | |
whatever | |
}: YourActualAppState) { | |
return { |
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
/** | |
* User Timing polyfill (http://www.w3.org/TR/user-timing/) | |
* @author RubaXa <trash@rubaxa.org> | |
*/ | |
(function (window){ | |
var | |
startOffset = Date.now ? Date.now() : +(new Date) | |
, performance = window.performance || {} | |
, _entries = [] |
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
GRAPHQL_URI=http://localhost:3001/graphql |
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
var webpack = require('webpack'); | |
var HtmlWebpackPlugin = require('html-webpack-plugin'); | |
var path = require('path'); | |
var folders = { | |
APP: path.resolve(__dirname, '../app'), | |
BUILD: path.resolve(__dirname, '../build'), | |
BOWER: path.resolve(__dirname, '../bower_components'), | |
NPM: path.resolve(__dirname, '../node_modules') | |
}; |
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 React, { Component } from 'react' | |
import Subapp from './subapp/Root' | |
class BigApp extends Component { | |
render() { | |
return ( | |
<div> | |
<Subapp /> | |
<Subapp /> | |
<Subapp /> |
With the release of Node 6.0.0, the surface of code that needs transpilation to use ES6 features has been reduced very dramatically.
This is what my current workflow looks like to set up a minimalistic and fast microservice using micro and async
+ await
.
OlderNewer