Skip to content

Move exported functions to the top-level src folder #1224

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 12, 2016
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
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import mapValues from './mapValues'
import mapValues from './utils/mapValues'

function bindActionCreator(actionCreator, dispatch) {
return (...args) => dispatch(actionCreator(...args))
Expand Down
8 changes: 4 additions & 4 deletions src/utils/combineReducers.js → src/combineReducers.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ActionTypes } from '../createStore'
import isPlainObject from './isPlainObject'
import mapValues from './mapValues'
import pick from './pick'
import { ActionTypes } from './createStore'
import isPlainObject from './utils/isPlainObject'
import mapValues from './utils/mapValues'
import pick from './utils/pick'

/* eslint-disable no-console */

Expand Down
File renamed without changes.
8 changes: 4 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import createStore from './createStore'
import combineReducers from './utils/combineReducers'
import bindActionCreators from './utils/bindActionCreators'
import applyMiddleware from './utils/applyMiddleware'
import compose from './utils/compose'
import combineReducers from './combineReducers'
import bindActionCreators from './bindActionCreators'
import applyMiddleware from './applyMiddleware'
import compose from './compose'

export {
createStore,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import expect from 'expect'
import { createStore, applyMiddleware } from '../../src/index'
import * as reducers from '../helpers/reducers'
import { addTodo, addTodoAsync, addTodoIfEmpty } from '../helpers/actionCreators'
import { thunk } from '../helpers/middleware'
import { createStore, applyMiddleware } from '../src/index'
import * as reducers from './helpers/reducers'
import { addTodo, addTodoAsync, addTodoIfEmpty } from './helpers/actionCreators'
import { thunk } from './helpers/middleware'

describe('applyMiddleware', () => {
it('wraps dispatch method with middleware once', () => {
Expand Down Expand Up @@ -69,7 +69,7 @@ describe('applyMiddleware', () => {
{
id: 1,
text: 'Hello'
},
},
{
id: 2,
text: 'World'
Expand All @@ -81,11 +81,11 @@ describe('applyMiddleware', () => {
{
id: 1,
text: 'Hello'
},
},
{
id: 2,
text: 'World'
},
},
{
id: 3,
text: 'Maybe'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import expect from 'expect'
import { bindActionCreators, createStore } from '../../src'
import { todos } from '../helpers/reducers'
import * as actionCreators from '../helpers/actionCreators'
import { bindActionCreators, createStore } from '../src'
import { todos } from './helpers/reducers'
import * as actionCreators from './helpers/actionCreators'

describe('bindActionCreators', () => {
let store
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import expect from 'expect'
import { combineReducers } from '../../src'
import createStore, { ActionTypes } from '../../src/createStore'
import { combineReducers } from '../src'
import createStore, { ActionTypes } from '../src/createStore'

describe('Utils', () => {
describe('combineReducers', () => {
Expand Down
2 changes: 1 addition & 1 deletion test/utils/compose.spec.js → test/compose.spec.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import expect from 'expect'
import { compose } from '../../src'
import { compose } from '../src'

describe('Utils', () => {
describe('compose', () => {
Expand Down