Skip to content

lucille-bellepleure/redux-persist-swarm-storage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

redux-persist storage adapter for ethereum swarm

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published