Skip to content
This repository has been archived by the owner on Dec 15, 2018. It is now read-only.

Move immutable/* re-exports to immutable/index.js #266

Merged
merged 3 commits into from Feb 5, 2018
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 14 additions & 1 deletion README.md
Expand Up @@ -377,7 +377,7 @@ To change how `<Link>` renders when its `href` matches the current location (i.e
`redux-little-router` supports the use of immutable.js in tandem with an `immutable`-aware `combineReducers` function like provided by [`redux-immutable`](https://github.com/gajus/redux-immutable). To use it, you will need to import the immutable version of the router or component you want to use. For instance,

```js
import { immutableRouterForBrowser, ImmutableLink } from 'redux-little-router';
import { immutableRouterForBrowser, ImmutableLink } from 'redux-little-router/es/immutable';
import { combineReducers } from 'redux-immutable';

const { reducer, enhancer, middleware } = immutableRouterForBrowser({ routes });
Expand All @@ -388,6 +388,19 @@ const store = createStore(
);
```

Depending on your environment, you might need to modify the import statement further. In that case, here are some tips:

```js
// works: ESM (preferred for webpack2+)
import { immutableRouterForBrowser } from 'redux-little-router/es/immutable';

// works: CJS (preferred for webpack1 or Node.js)
import { immutableRouterForBrowser } from 'redux-little-router/lib/immutable';

// DOESN'T WORK
import { immutableRouterForBrowser } from 'redux-little-router/immutable';
```

## Environment

`redux-little-router` requires an ES5 compatible environment (no IE8).
Expand Down
3 changes: 2 additions & 1 deletion demo/client/app.js
Expand Up @@ -14,7 +14,8 @@ import {
// import { createStore, compose, applyMiddleware } from 'redux';
// import { combineReducers } from 'redux-immutable';
// import { Map, fromJS } from 'immutable';
// import { immutableRouterForBrowser, initializeCurrentLocation } from '../../src';
// import { immutableRouterForBrowser } from '../../src/immutable';
// import { initializeCurrentLocation } from '../../src';

import routes from './routes';
import wrap from './wrap';
Expand Down
2 changes: 1 addition & 1 deletion demo/client/demo.js
Expand Up @@ -6,7 +6,7 @@ import chunk from 'lodash.chunk';

/* Invert comments for immutable */
import { Link, Fragment } from '../../src';
// import { ImmutableLink as Link, ImmutableFragment as Fragment } from '../../src';
// import { ImmutableLink as Link, ImmutableFragment as Fragment } from '../../src/immutable';

import styles from './demo.css';

Expand Down
2 changes: 1 addition & 1 deletion demo/server/index.js
Expand Up @@ -29,7 +29,7 @@ const redux = require('redux');
/* Invert comments for immutable */
const routerForExpress = require('../../src').routerForExpress;
const combineReducers = redux.combineReducers;
// const routerForExpress = require('../../src').immutableRouterForExpress;
// const routerForExpress = require('../../src/immutable').immutableRouterForExpress;
// const Map = require('immutable').Map;
// const combineReducers = require('redux-immutable').combineReducers;

Expand Down