Skip to content

pierrickouw/redux-devtools-prompt-state

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

redux-devtools-prompt-state

This is a small module to debug redux app. After the setup, just press shift+s by default to see a prompt of your current state. You can save it for later use, or replace it with another one.

Setup

npm i --save-dev redux-devtools-prompt-state

Be careful to only put this in dev - use a flag in your build! (or be aware in prod)

Create your store with the replaceState enhancers

import { createStore, compose } from 'redux'
import rootReducer from '../reducers'
import { replaceState, replacer } from 'redux-devtools-prompt-state';

function configureStore(initialState)
{
  const createWithReplaceState = compose(replaceState())(createStore); // replaceState can take an array of key sequence
  const store = createWithReplaceState(rootReducer, initialState);
  replacer(store, [ 'shift+k' ]); // replacer for dom - could be extended in the future

  return store
}

replaceState

replacer(store, keys) takes an array of key sequences as second argument as defined here

About

Prompt and replace state of your redux app

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published