I hereby claim:
- I am laytong on github.
- I am laytong (https://keybase.io/laytong) on keybase.
- I have a public key ASCyt6lo0OK-LX3x-ZafvydihUNq1fPyeqqhihrypK3jdQo
To claim this, I am signing this object:
const initialObjectivesState = { | |
aString: '', | |
}; | |
/* | |
* As the number of actions increases, the cyclomatic complexity of the reducer will skyrocket | |
*/ | |
const Reducer = function (state = initialObjectivesState, action) { | |
switch(action.type){ | |
"UPDATE_STRING": function(state, action){ |
const defaultState = { | |
person: { | |
name: '' | |
age: 20, | |
friends: [] | |
pets: [] | |
} | |
} | |
const actionMap = { |
import React, {Component, PropTypes} from 'react'; | |
class BadInputComponent extends Component { | |
static propTypes = { | |
text = PropTypes.string.isRequired, | |
updateText = PropTypes.func.isRequired, | |
}; | |
render() { | |
return ( |
I hereby claim:
To claim this, I am signing this object:
import { useState, useCallback } from 'react'; | |
const useToggle = (initialState) => { | |
const [isOpen, setIsOpen] = useState(initialState); | |
// Flip whatever is the current state | |
const toggle = useCallback( | |
() => setIsOpen(state => !state), | |
[setIsOpen], | |
); |