This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { AppRegistry, View, Text } from 'react-native'; | |
const AppContainer = () => { | |
console.warn('Rendering component'); | |
console.log('simple log'); | |
return ( | |
<View> | |
<Text> | |
Hello world |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as actions from "../actions/todos"; | |
const INITIAL_STATE = { | |
items: ['initial', 'todo', 'items'], | |
loading: false | |
} | |
export default (state = INITIAL_STATE, action) => { | |
console.log('action type is', action.type); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const ADD_TODO = "ADD_TODO"; | |
export const GET_TODOS_INIT = "GET_TODOS_INIT"; | |
export const GET_TODOS = "GET_TODOS"; | |
export function addTodo(text) { | |
return { | |
type: ADD_TODO, | |
text: text | |
}; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component, PropTypes } from "react"; | |
//redux | |
import { bindActionCreators } from "redux"; | |
import { connect } from "react-redux"; | |
import { addTodo, getTodos } from "../actions/todos"; | |
//components | |
import TodoList from "../components/TodoList"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { createAction, handleActions } from 'redux-actions' | |
import axios from 'axios' | |
import {async, addWithLoading, deleteWithLoading, getWithLoading} from './redux-helpers' | |
const API = 'http://localhost:3000/v1' | |
// ------------------------------------ | |
// Initial state | |
// ------------------------------------ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const deleteFromArray = (itemKey, loadingKey, stateProperty) => (state, action) => { | |
return { | |
...state, | |
[loadingKey]: false, | |
[stateProperty]: state[stateProperty].filter(item => item[itemKey] !== action.value) | |
} | |
} | |
export const addToArray = (collection, loadingKey) => (state, action) => { | |
return { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default connect( | |
({storage, addStorageForm}) => ({ | |
...pick(storage, ['storages', 'loading']), | |
...pick(addStorageForm, ['editingStorageItem']), | |
}), | |
dispatch => ({ | |
actions: bindActionCreators({...storageActions, ...addStorageFormActions}, dispatch) | |
}) | |
)(Container); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {StyleSheet} from 'aphrodite'; | |
const flexsheet = StyleSheet.create({ | |
horizontal: { | |
display: 'flex', | |
flexDirection: 'row' | |
}, | |
vertical: { | |
display: 'flex', | |
flexDirection: 'column' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function (plop) { | |
/* Helpers */ | |
plop.addHelper('upperCase', function (text) { | |
return text.toUpperCase(); | |
}); | |
/* Files */ | |
var createIndex = { | |
type: 'add', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//without mixins | |
const header = { | |
position: 'absolute', | |
top: 0, | |
bottom:0, | |
left:0, | |
right:0, | |
"@media max-width 3948 min-width 1038 mobile blah": { | |
paddingTop:10; | |
paddingBottom:10; |