Skip to content

Instantly share code, notes, and snippets.

View btg5679's full-sized avatar
🎯
Focusing

bg btg5679

🎯
Focusing
View GitHub Profile
@btg5679
btg5679 / ReduxIntro1.txt
Last active July 14, 2017 20:00
ReduxIntro1
import { createStore } from 'redux';
// Store
const dataStore = createStore(r, {
beerlist: {
name: 'IPA',
abv: 7.4
},
beersOnTap: 1,
liveMusicHistory: {
import { createStore } from 'redux';
const reducer = function(state, action){
if(action.type === 'CMT'){
return state + action.payload;
}
return state;
}
const store = createStore(r, {
import { createStore } from 'redux';
const store = createStore(r, {
user: {
name: 'wacko',
age: 48
},
commentCount: 2,
loginHistory: {
loginDate: '2017-01-01',
@btg5679
btg5679 / ReduxExampleStore
Last active July 14, 2017 01:59
Redux Example Store
import { createStore } from 'redux';
const store = createStore(r, {
user: {
name: 'wacko',
age: 48
},
commentCount: 2,
loginHistory: {
loginDate: '2017-01-01',
const store = createStore(r, {
user: {
name: 'wacko',
age: 48
},
comments: ['hi', 'hola']
});
const store = createStore(r, {
user: {
name: 'wacko',
age: 48
},
comments: ['hi', 'hola']
});