0.0.1 • Published 4 years ago

redux-persist-swarm-storage v0.0.1

Weekly downloads
4
License
MIT
Repository
github
Last release
4 years ago

Redux Persist Swarm Storage Adapter

Redux Persist storage adapter for Swarm.

Installation

npm install --save redux-persist-swarm-storage

You will also need fds.js: npm install --save fds.js

Usage

Browser

import { persistStore, persistCombineReducers } from 'redux-persist'
import { CookieStorage } from 'redux-persist-cookie-storage'
import FDS from 'fds.js'

const fds = new FDS()

const account = {
    address: "",
    privateKey: ""
}

const persistConfig = {
    key: "rppt",
    storage: new SwarmStorage(
        fds,
        account,
        {
            keyPrefix: "..."
        }
    )
}

const rootReducer = persistCombineReducers(persistConfig, reducers)

const store = createStore(rootReducer, undefined)

const persistor = persistStore(store, {})

Development

Running tests

npm test