I hereby claim:
- I am erikras on github.
- I am erikras (https://keybase.io/erikras) on keybase.
- I have a public key ASBKqAeWHhNv0eDi5m-_tjdje5Adf8HqJnK2FROuaIbdago
To claim this, I am signing this object:
const startTime = Date.now(); | |
function generatePermutations(dictionary) { | |
const results = []; | |
const permute = (array, position) => { | |
if (position === array.length - 1) { | |
results.push(array); | |
} else { | |
for (let i = position; i < array.length; i++) { | |
const swap = array[position]; | |
array.splice(position, 1, array[i]); |
import React, { Component } from 'react' | |
import MyWrappedComponent from './MyWrappedComponent' | |
export default class MyContainer extends Component { | |
constructor() { | |
// bind handlers | |
this.handleLoad = this.handleLoad.bind(this) | |
this.handleSave = this.handleSave.bind(this) | |
this.handleClear = this.handleClear.bind(this) | |
} |
v6.2.2 | |
3.9.5 | |
redux-form@6.0.1 /Users/erik/oss/redux-form | |
├── array-findindex-polyfill@0.1.0 | |
├─┬ babel-cli@6.14.0 | |
│ ├─┬ babel-polyfill@6.13.0 | |
│ │ └── regenerator-runtime@0.9.5 | |
│ ├── babel-runtime@6.11.6 | |
│ ├─┬ bin-version-check@2.1.0 | |
│ │ ├─┬ bin-version@1.0.4 |
I hereby claim:
To claim this, I am signing this object:
import React, { Component } from 'react' | |
import MyWrappedComponent from './MyWrappedComponent' | |
export default class MyContainer extends Component { | |
constructor() { | |
// bind handlers | |
this.handleCallback = this.handleCallback.bind(this) | |
} | |
handleCallback(load, save, clear) { |
import MyCustomButton from './ui/MyCustomButton' | |
class MyClicker extends Component { | |
constructor() { | |
super() | |
this.state = { clicked: false } | |
} | |
handleClick() { | |
this.setState({ clicked: true }) |
import MyCustomButton from './ui/MyCustomButton' | |
class MyClicker extends Component { | |
constructor() { | |
super() | |
this.state = { clicked: false } | |
} | |
render() { | |
return <div> |
import MyCustomButton from './ui/MyCustomButton' | |
class MyClicker extends Component { | |
constructor() { | |
super() | |
this.state = { clicked: false } | |
this.handleClick = this.handleClick.bind(this) // Problem solved! | |
} | |
handleClick() { |
import MyCustomButton from './ui/MyCustomButton' | |
class MyClicker extends Component { | |
constructor() { | |
super() | |
this.state = { clicked: false } | |
} | |
handleClick = () => { | |
// "this" is the right instance of this component |
/** Clears a form value */ | |
const clear = ([name], state, { changeValue }) => { | |
changeValue(state, name, () => undefined) | |
} | |
/** Converts a form value to uppercase **/ | |
const upper = ([name], state, { changeValue }) => { | |
changeValue(state, name, value => value && value.toUpperCase()) | |
} |