Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
5 changes: 3 additions & 2 deletions examples/counter/containers/App.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import CounterApp from './CounterApp';
import { createStore, applyMiddleware } from 'redux';
import { createStore, applyMiddleware, combineReducers } from 'redux';
import { Provider } from 'react-redux';
import * as reducers from '../reducers';

Expand All @@ -13,7 +13,8 @@ function thunk({ dispatch, getState }) {
}

const createStoreWithMiddleware = applyMiddleware(thunk)(createStore);
const store = createStoreWithMiddleware(reducers);
const reducer = combineReducers(reducers);
const store = createStoreWithMiddleware(reducer);

export default class App {
render() {
Expand Down
5 changes: 3 additions & 2 deletions examples/todomvc/containers/App.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import React from 'react';
import TodoApp from './TodoApp';
import { createStore } from 'redux';
import { createStore, combineReducers } from 'redux';
import { Provider } from 'react-redux';
import * as reducers from '../reducers';

const store = createStore(reducers);
const reducer = combineReducers(reducers);
const store = createStore(reducer);

export default class App {
render() {
Expand Down
12 changes: 2 additions & 10 deletions src/createStore.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
import Store from './Store';
import combineReducers from './utils/combineReducers';

export default function createStore(
reducer,
initialState
) {
const finalReducer = typeof reducer === 'function' ?
reducer :
combineReducers(reducer);

const store = new Store(finalReducer, initialState);
export default function createStore(reducer, initialState) {
const store = new Store(reducer, initialState);

return {
dispatch: ::store.dispatch,
Expand Down
209 changes: 0 additions & 209 deletions test/Store.spec.js

This file was deleted.

Loading