Skip to content

Instantly share code, notes, and snippets.

View GuilhermeLis's full-sized avatar
🦁
Focusing

Guilherme Lisboa GuilhermeLis

🦁
Focusing
View GitHub Profile
@GuilhermeLis
GuilhermeLis / ReactotronConfig.ts
Last active November 20, 2020 15:37
ReactotronConfig from Redux with AsyncStorage
import Reactotron from 'reactotron-react-native';
import { reactotronRedux } from 'reactotron-redux';
import reactotronSaga from 'reactotron-redux-saga';
declare global {
interface Console {
tron: any;
}
}
@GuilhermeLis
GuilhermeLis / ducks.ts
Created November 20, 2020 14:17
auth/ducks.ts from Redux with AsyncStorage
import { createReducer, createActions } from 'reduxsauce';
import Immutable from 'seamless-immutable';
const { Types, Creators } = createActions({
signInRequest: ['email', 'password'],
});
export const AuthTypes = Types;
export default Creators;
@GuilhermeLis
GuilhermeLis / rootReducer.ts
Created November 20, 2020 14:15
File from the Redux with AsyncStorage
import { combineReducers } from 'redux';
import { reducer as auth } from './auth/ducks';
export default combineReducers({
auth,
});
@GuilhermeLis
GuilhermeLis / persistReducers.ts
Created November 20, 2020 14:13
persistReducers from Redux with AsyncStorage
import AsyncStorage from '@react-native-async-storage/async-storage';
import { persistReducer } from 'redux-persist';
export default (reducers: any) => {
const persistedReducer = persistReducer(
{
key: 'redux-with-asyncstorage',
storage: AsyncStorage,
blacklist: [],
},
@GuilhermeLis
GuilhermeLis / index.tsx
Last active November 20, 2020 14:07
src/Index.tsx from Redux with AsyncStorage
import React from 'react';
import { Provider } from 'react-redux';
import { PersistGate } from 'redux-persist/integration/react';
import { store, persistor } from './store';
import Routes from './routes';
import './config/ReactotronConfig';
@GuilhermeLis
GuilhermeLis / App.tsx
Last active November 20, 2020 14:08
Index from article use Redux with asyncStorage
import React from 'react';
import Index from './src';
const App = () => (
<Index />
);
export default App;
{
"editor.formatOnPaste": true,
"editor.rulers": [
80,
120
],
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true,
},
"eslint.packageManager": "npm",