1.0.3 • Published 6 years ago

redux-persist-realmpackage v1.0.3

Weekly downloads
4
License
MIT
Repository
github
Last release
6 years ago
  • HOW TO USE

#IN STORE.JS

import { compose, createStore, applyMiddleware } from 'redux'; import thunk from 'redux-thunk'; import reducer from '../reducers'; import { persistReducer, persistStore } from 'redux-persist'; import realmPersistInstance from 'redux-persist-realm';

const persistConfig = { key: 'root', storage: realmPersistInstance }

const persistedReducer = persistReducer(persistConfig, reducer);

const store = createStore(persistedReducer, applyMiddleware(thunk)); const persistor = persistStore(store);

export { store, persistor }

#USE

import { store, persistor } from './src/redux/store';

import { PersistGate } from 'redux-persist/integration/react';

const renderAppWithRedux = () => ( );

AppRegistry.registerComponent('root', () => renderAppWithRedux);