@brighte/redux-persist-realm

A Realmjs interface for redux-persist

Stats

stars 🌟issues ⚠️updated 🛠created 🐣size 🏋️‍♀️
00Jun 10, 2018Jun 9, 2018Minified + gzip package size for @brighte/redux-persist-realm in KB

Readme

Redux-persist-realm

A Realmjs interface for redux-persist

Dependencies

Installation

If you already have realm and redux-persist

npm i --save redux-persist-realm
# or
yarn add redux-persist-realm

Else

npm i --save redux-persist realm redux-persist-realm
# or
yarn add redux-persist realm redux-persist-realm
react-native link realm

Usage

import {compose, applyMiddleware, createStore} from 'redux'
import {persistStore, autoRehydrate} from 'redux-persist'
+ import realmPersistInterface from 'redux-persist-realm'

// add `autoRehydrate` as an enhancer to your store (note: `autoRehydrate` is not a middleware)
const store = createStore(
  reducer,
  undefined,
  compose(
    applyMiddleware(...),
    autoRehydrate()
  )
)

+ const config = {
+   storage: realmPersistInterface
+ }

// begin periodically persisting the store
- persistStore(store)
+ persistStore(store, config)

Don't hesitate to publish Issues if you see something missing!

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.