Tested under webpack-dev-server 1.7.0.
- Clone this gist
npm installnpm start- Visit http://localhost:8080 (or http://192.168.x.x:8080) on multiple devices
- Edit entry.js and hit save
| { | |
| "ecmaFeatures": { | |
| "arrowFunctions": true, | |
| "binaryLiterals": false, | |
| "blockBindings": true, | |
| "classes": true, | |
| "defaultParams": true, | |
| "destructuring": true, | |
| "forOf": false, | |
| "generators": true, |
Tested under webpack-dev-server 1.7.0.
npm installnpm start| import assign from "object-assign"; | |
| import Flux from "flummox"; | |
| import React from "react"; | |
| export default React.createClass({ | |
| displayName: "FluxContainer", | |
| contextTypes: { | |
| flux: React.PropTypes.instanceOf(Flux), | |
| }, |
| // Extracted from a live application. Known to work with latest Chrome/Firefox | |
| // and Animate.css. (IE untested) | |
| export let AnimationMixin= { | |
| playAnimation( animation='pulse', speed=1000) { | |
| if(! this.isMounted()) { | |
| log.warn( "Trying to call .playAnimation() on an unmounted component!") | |
| return | |
| } |
| import Alt from 'alt'; | |
| import DispatcherRecorder from 'alt/utils/DispatcherRecorder'; | |
| let alt = new Alt(); | |
| let recorder = new DispatcherRecorder(alt); | |
| // setup actions and store | |
| function Actions() { this.generateActions('a', 'b', 'c'); } |
| import { Component } from "React"; | |
| export var Enhance = ComposedComponent => class extends Component { | |
| constructor() { | |
| this.state = { data: null }; | |
| } | |
| componentDidMount() { | |
| this.setState({ data: 'Hello' }); | |
| } | |
| render() { |
| 'use strict'; | |
| var React = require('react'); | |
| function createAsyncHandler(getHandlerAsync, displayName) { | |
| var Handler = null; | |
| return React.createClass({ | |
| displayName: displayName, |
##The Good, The Bad, & The Ugly Ways of handling Async Operations With Javascript## #####Callbacks < Promises < Generators#####
| function interceptFunction (object, fnName, options) { | |
| var noop = function () {}; | |
| var fnToWrap = object[fnName]; | |
| var before = options.before || noop; | |
| var after = options.after || noop; | |
| object[fnName] = function () { | |
| before.apply(this, arguments); | |
| var result = fnToWrap.apply(this, arguments); | |
| after.apply(this, arguments); |
Leaving this for historical reasons, but with the latest iteration I set up proper dotfiles. Check em out
After too many years of tinkering my machine is a bit all over. With Mojave High Sierra Montery I wanted to start fresh
Make sure everything is up to date.