Skip to content
This repository was archived by the owner on Oct 26, 2018. It is now read-only.

Commit 23596cf

Browse files
committed
uses es6 import/export
1 parent 987997b commit 23596cf

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "0.0.10",
44
"description": "Ruthlessly simple bindings to keep react-router and redux in sync",
55
"main": "lib/index",
6+
"jsnext:main": "src/index",
67
"repository": {
78
"type": "git",
89
"url": "https://github.com/jlongster/redux-simple-router.git"

src/index.js

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
const deepEqual = require('deep-equal');
1+
import deepEqual from 'deep-equal';
22

33
// Constants
44

5-
const UPDATE_PATH = "@@router/UPDATE_PATH";
5+
export const UPDATE_PATH = "@@router/UPDATE_PATH";
66
const SELECT_STATE = state => state.routing;
77

88
// Action creator
99

10-
function pushPath(path, state, { avoidRouterUpdate = false } = {}) {
10+
export function pushPath(path, state, { avoidRouterUpdate = false } = {}) {
1111
return {
1212
type: UPDATE_PATH,
1313
payload: {
@@ -19,7 +19,7 @@ function pushPath(path, state, { avoidRouterUpdate = false } = {}) {
1919
};
2020
}
2121

22-
function replacePath(path, state, { avoidRouterUpdate = false } = {}) {
22+
export function replacePath(path, state, { avoidRouterUpdate = false } = {}) {
2323
return {
2424
type: UPDATE_PATH,
2525
payload: {
@@ -58,7 +58,7 @@ function locationsAreEqual(a, b) {
5858
return a.path === b.path && deepEqual(a.state, b.state);
5959
}
6060

61-
function syncReduxAndRouter(history, store, selectRouterState = SELECT_STATE) {
61+
export function syncReduxAndRouter(history, store, selectRouterState = SELECT_STATE) {
6262
const getRouterState = () => selectRouterState(store.getState());
6363
let lastChangeId = 0;
6464

@@ -107,8 +107,4 @@ function syncReduxAndRouter(history, store, selectRouterState = SELECT_STATE) {
107107
};
108108
}
109109

110-
exports.UPDATE_PATH = UPDATE_PATH;
111-
exports.pushPath = pushPath;
112-
exports.replacePath = replacePath;
113-
exports.syncReduxAndRouter = syncReduxAndRouter;
114-
exports.routeReducer = update
110+
export { update as routeReducer };

0 commit comments

Comments
 (0)