This file contains 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 { TextInput } from 'react-native'; | |
import React, { Component } from 'react'; | |
import styles from './styles'; | |
import { connect } from 'react-redux'; | |
import { addTask } from '../TodoList/actions'; | |
class AddTodoItem extends Component { | |
render() { | |
return ( | |
<TextInput |
This file contains 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 { View, Text, TouchableOpacity, Image } from 'react-native'; | |
import React, { Component, PropTypes } from 'react'; | |
import styles from './styles'; | |
import Swipeout from 'react-native-swipeout'; | |
class TodoItem extends Component { | |
render() { | |
const swipeoutBtns = [{ | |
text: 'Delete', | |
backgroundColor: 'red', |
This file contains 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 { View, ListView } from 'react-native'; | |
import React, { Component, PropTypes } from 'react'; | |
import styles from './styles'; | |
import { connect } from 'react-redux'; | |
import { createSelector } from 'reselect'; | |
import { selectAllTodos, selectActiveTodos, selectCompletedTodos } from './reducer'; | |
import { toggleTaskCompletion, deleteTask } from './actions'; | |
import NoTodos from '../NoTodos'; | |
import TodoItem from '../TodoItem'; |
This file contains 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 { fromJS } from 'immutable'; | |
import { TOGGLE_TASK_COMPLETION, ADD_TASK, DELETE_TASK } from './constants'; | |
const initialState = fromJS([ | |
{ text:'Buy milk', id: '1', isComplete: false }, | |
{ text:'Drink milk', id: '2', isComplete: false }, | |
{ text:'Repeat', id:'3', isComplete: false } | |
]); | |
function todos(state = initialState, action) { |
This file contains 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
// app/store.js | |
import { createStore, compose } from 'redux'; | |
import { fromJS } from 'immutable'; | |
import createReducer from './reducers'; | |
import devTools from 'remote-redux-devtools'; | |
function configureStore(initialState = fromJS({})) { | |
if (__DEV__) { | |
const createStoreWithMiddleware = compose(devTools())(createStore); |
This file contains 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
npm run ios |
This file contains 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
// app/reducers.js | |
import { combineReducers } from 'redux-immutable'; | |
// XX: Do not rename this variable if you want reducer generator | |
// to keep working properly (and you do want that, right?) | |
const applicationReducers = { | |
removeThisReducerOnceYouAddALegitOne: () => ({}), | |
}; |
This file contains 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
// app/setup.js | |
import App from './components/App'; | |
import React, { Component } from 'react'; | |
import { Provider } from 'react-redux'; | |
import configureStore from './store'; | |
const store = configureStore(); | |
function setup() { |
This file contains 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
git clone https://github.com/thebakeryio/baker.git TodoMVC | |
cd TodoMVC && npm install && npm run setup |