Add reselect devtools

This commit is contained in:
Alfred Melch 2019-12-22 19:02:10 +01:00
parent 247ba964ec
commit 797ef6a1fa
3 changed files with 16 additions and 1 deletions

8
package-lock.json generated
View File

@ -9796,6 +9796,14 @@
"resolved": "https://registry.npmjs.org/reselect/-/reselect-4.0.0.tgz",
"integrity": "sha512-qUgANli03jjAyGlnbYVAV5vvnOmJnODyABz51RdBN7M4WaVu8mecZWgyQNkG8Yqe3KRGRt0l4K4B3XVEULC4CA=="
},
"reselect-tools": {
"version": "0.0.7",
"resolved": "https://registry.npmjs.org/reselect-tools/-/reselect-tools-0.0.7.tgz",
"integrity": "sha512-+RGguS8ph21y04l6YwQwL+VfJ/c0qyZKCkhCd5ZwbNJ/lklsJml3CIim+uaG/t+7jYZQcwDW4bk5+VzTeuzwtw==",
"requires": {
"reselect": "4.0.0"
}
},
"resolve": {
"version": "1.13.1",
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.13.1.tgz",

View File

@ -24,7 +24,8 @@
"react-redux": "^7.1.3",
"redux": "^4.0.4",
"regenerator-runtime": "^0.13.3",
"reselect": "^4.0.0"
"reselect": "^4.0.0",
"reselect-tools": "0.0.7"
},
"devDependencies": {
"@babel/core": "^7.7.5",

View File

@ -1,8 +1,14 @@
import { createStore } from 'redux'
import { registerSelectors, getStateWith } from 'reselect-tools'
import { reducerFn, initialState } from './reducer'
import * as selectors from './selectors'
export const store = createStore(
reducerFn,
initialState,
window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__()
)
registerSelectors(selectors)
getStateWith(() => store.getState())