Skip to content

Commit

Permalink
Allow Redux DevTools browser extension to be used. (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
ray-lee authored Oct 15, 2021
1 parent 6ef7081 commit a828d1f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ There are end-to-end tests that run on Nightwatch. This selenium-based test runn

To set up credentials and run the tests, check out the [README](/tests/README.md) in `/tests/.

## Debugging

The [Redux DevTools browser extension](https://github.com/reduxjs/redux-devtools/tree/main/extension) may be used to easily inspect app states and state transitions.

## License

```
Expand Down
10 changes: 9 additions & 1 deletion src/store.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {
compose,
createStore,
combineReducers,
applyMiddleware,
Expand All @@ -14,8 +15,15 @@ const reducers: Reducer = combineReducers({
catalog: catalogReducers,
});

const composeEnhancers =
window["__REDUX_DEVTOOLS_EXTENSION_COMPOSE__"] || compose;

/** Build a redux store with reducers specific to the admin interface
as well as reducers from opds-web-client. */
export default function buildStore(initialState?: State): Store<State> {
return createStore(reducers, initialState, applyMiddleware(thunk));
return createStore(
reducers,
initialState,
composeEnhancers(applyMiddleware(thunk))
);
}

0 comments on commit a828d1f

Please sign in to comment.