0.0.4 • Published 10 years ago

redux-devtools-prompt-state v0.0.4

Weekly downloads
8
License
ISC
Repository
github
Last release
10 years ago

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

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago