Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
rename configureStore param initialState to preloadedState
  • Loading branch information
dliv committed May 26, 2016
commit a06ebfa5e189469dd4e99468b852400d5c89a265
4 changes: 2 additions & 2 deletions docs/advanced/ExampleRedditAPI.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,10 @@ import rootReducer from './reducers'

const loggerMiddleware = createLogger()

export default function configureStore(initialState) {
export default function configureStore(preloadedState) {
return createStore(
rootReducer,
initialState,
preloadedState,
applyMiddleware(
thunkMiddleware,
loggerMiddleware
Expand Down
4 changes: 2 additions & 2 deletions examples/async/store/configureStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import thunkMiddleware from 'redux-thunk'
import createLogger from 'redux-logger'
import rootReducer from '../reducers'

export default function configureStore(initialState) {
export default function configureStore(preloadedState) {
const store = createStore(
rootReducer,
initialState,
preloadedState,
applyMiddleware(thunkMiddleware, createLogger())
)

Expand Down
4 changes: 2 additions & 2 deletions examples/real-world/store/configureStore.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import api from '../middleware/api'
import rootReducer from '../reducers'
import DevTools from '../containers/DevTools'

export default function configureStore(initialState) {
export default function configureStore(preloadedState) {
const store = createStore(
rootReducer,
initialState,
preloadedState,
compose(
applyMiddleware(thunk, api, createLogger()),
DevTools.instrument()
Expand Down
4 changes: 2 additions & 2 deletions examples/real-world/store/configureStore.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import thunk from 'redux-thunk'
import api from '../middleware/api'
import rootReducer from '../reducers'

export default function configureStore(initialState) {
export default function configureStore(preloadedState) {
return createStore(
rootReducer,
initialState,
preloadedState,
applyMiddleware(thunk, api)
)
}
4 changes: 2 additions & 2 deletions examples/todomvc/store/configureStore.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { createStore } from 'redux'
import rootReducer from '../reducers'

export default function configureStore(initialState) {
const store = createStore(rootReducer, initialState)
export default function configureStore(preloadedState) {
const store = createStore(rootReducer, preloadedState)

if (module.hot) {
// Enable Webpack hot module replacement for reducers
Expand Down
4 changes: 2 additions & 2 deletions examples/tree-view/store/configureStore.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { createStore } from 'redux'
import reducer from '../reducers'

export default function configureStore(initialState) {
const store = createStore(reducer, initialState)
export default function configureStore(preloadedState) {
const store = createStore(reducer, preloadedState)

if (module.hot) {
// Enable Webpack hot module replacement for reducers
Expand Down
4 changes: 2 additions & 2 deletions examples/universal/client/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import { Provider } from 'react-redux'
import configureStore from '../common/store/configureStore'
import App from '../common/containers/App'

const initialState = window.__INITIAL_STATE__
const store = configureStore(initialState)
const preloadedState = window.__INITIAL_STATE__
const store = configureStore(preloadedState)
const rootElement = document.getElementById('app')

render(
Expand Down
4 changes: 2 additions & 2 deletions examples/universal/common/store/configureStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import { createStore, applyMiddleware } from 'redux'
import thunk from 'redux-thunk'
import rootReducer from '../reducers'

export default function configureStore(initialState) {
export default function configureStore(preloadedState) {
const store = createStore(
rootReducer,
initialState,
preloadedState,
applyMiddleware(thunk)
)

Expand Down
4 changes: 2 additions & 2 deletions examples/universal/server/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ function handleRender(req, res) {
const counter = parseInt(params.counter, 10) || apiResult || 0

// Compile an initial state
const initialState = { counter }
const preloadedState = { counter }

// Create a new Redux store instance
const store = configureStore(initialState)
const store = configureStore(preloadedState)

// Render the component to a string
const html = renderToString(
Expand Down