Skip to content

Instantly share code, notes, and snippets.

View pfulop's full-sized avatar
😈
YEAH!

Pavol Fulop pfulop

😈
YEAH!
  • Trondheim, Norway
View GitHub Profile
/**
* Sample React Native App
* https://github.com/facebook/react-native
* @flow
*/
import {
AppRegistry,
} from 'react-native';
import App from './app';
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);
const initialState = {
};
export default (state = initialState, action) => {
switch (action.type) {
default:
return state;
}
};
import { combineReducers } from 'redux';
import item from './item';
const rootReducer = combineReducers({
item
});
export default rootReducer;
import React, { Component } from 'react';
import {
StyleSheet,
Text,
View
} from 'react-native';
class TheCall extends Component {
render() {
return (
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}>
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,
export const CHANGED_ITEMS="CHANGED_ITEMS";
export function pushItem(item){
return (dispatch,_,firebaseApp)=>{
const itemsRef = getItemsRef(firebaseApp);
itemsRef.push({title:item});
};
}
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;
//@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';