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
/** | |
* Sample React Native App | |
* https://github.com/facebook/react-native | |
* @flow | |
*/ | |
import { | |
AppRegistry, | |
} from 'react-native'; | |
import App from './app'; |
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 { createStore } from 'redux'; | |
import rootReducer from '../reducers'; | |
export default function configureStore () { | |
const store = createStore(rootReducer); | |
if (module.hot) { | |
module.hot.accept(() => { | |
const nextRootReducer = require('../reducers/index').default; | |
store.replaceReducer(nextRootReducer); |
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
const initialState = { | |
}; | |
export default (state = initialState, action) => { | |
switch (action.type) { | |
default: | |
return state; | |
} | |
}; |
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 { combineReducers } from 'redux'; | |
import item from './item'; | |
const rootReducer = combineReducers({ | |
item | |
}); | |
export default rootReducer; |
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 React, { Component } from 'react'; | |
import { | |
StyleSheet, | |
Text, | |
View | |
} from 'react-native'; | |
class TheCall extends Component { | |
render() { | |
return ( |
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 React from 'react'; | |
import { AppRegistry } from 'react-native'; | |
import configureStore from './store/index'; | |
import App from './components/App'; | |
import { Provider } from 'react-redux'; | |
const store = configureStore(); | |
export default () => ( | |
<Provider store={store}> |
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 { createStore,applyMiddleware } from 'redux'; | |
import rootReducer from '../reducers'; | |
import {APIKEY,AUTHDOMAIN,DATABASEURL,STORAGEBUCKET} from '../../config.js'; | |
import firebase from 'firebase'; | |
import thunk from 'redux-thunk'; | |
export default function configureStore () { | |
const firebaseConfig = { | |
apiKey: APIKEY, |
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
export const CHANGED_ITEMS="CHANGED_ITEMS"; | |
export function pushItem(item){ | |
return (dispatch,_,firebaseApp)=>{ | |
const itemsRef = getItemsRef(firebaseApp); | |
itemsRef.push({title:item}); | |
}; | |
} |
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 {CHANGED_ITEMS} from '../actions/items'; | |
const initialState = []; | |
export default (state = initialState, action) => { | |
switch (action.type) { | |
case CHANGED_ITEMS: | |
return action.data; | |
default: | |
return state; |
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
//@flow | |
import React, { Component } from 'react'; | |
import { | |
Text, | |
View | |
} from 'react-native'; | |
import {pushItem,removeItem,updateItem,watchItems,unWatchItems} from '../actions/items'; | |
import {connect} from 'react-redux'; | |
import AddItem from './AddItem'; |
OlderNewer