Skip to content

Instantly share code, notes, and snippets.

View conradbkay's full-sized avatar
🇺🇸

Kay conradbkay

🇺🇸
  • Massachusetts
View GitHub Profile
@conradbkay
conradbkay / dispatch.js
Created July 10, 2017 23:58
Gist description...
{
type: "ADD_TASK",
taskType: 'VeryImportantTasks'
}
const Counter = ({onIncrement, value}) => (
<div>
<h1>{value}</h1>
<button onClick={onIncrement}</button>
</div>
)
@conradbkay
conradbkay / reducer.js
Last active July 2, 2017 18:34
example reducer
const state = {
buttonValue: 0
}
const action = {
type: "INCREMENT_BUTTON"
value: 30
}
const reducer = (state, action) => {
switch(action.type) {
case "INCREMENT_BUTTON":
@conradbkay
conradbkay / state.js
Last active July 2, 2017 02:25
example state in redux
{
signedIn: false,
userList: [
{
name: "MATHDUDE",
favNum: 3.14159
},
{
name: "Grumpy man",
favNum: 0