redux-persist-realmpackage

1.0.3 • Public • Published
  • 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);

Dependencies (0)

    Dev Dependencies (4)

    Package Sidebar

    Install

    npm i redux-persist-realmpackage

    Weekly Downloads

    0

    Version

    1.0.3

    License

    MIT

    Unpacked Size

    42.8 kB

    Total Files

    4

    Last publish

    Collaborators

    • tassio.rocha