Skip to content

Commit

Permalink
fix($docs): update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
faceyspacey committed Jul 27, 2017
1 parent 7645424 commit 2456517
Show file tree
Hide file tree
Showing 24 changed files with 7,584 additions and 474 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ module.exports = {
'import/no-unresolved': 1,
'flowtype/no-weak-types': 1,
'consistent-return': 1,
'no-nested-ternary': 1,
semi: [2, 'never'],
'no-console': [2, { allow: ['warn', 'error'] }],
'flowtype/semi': [2, 'never'],
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ notifications:
email: false
webhooks:
urls:
- https://webhooks.gitter.im/e/d3ef59f99b0a3955be68
- https://webhooks.gitter.im/e/5156be73e058008e1ed2
on_success: always # options: [always|never|change] default: always
on_failure: always # options: [always|never|change] default: always
on_start: never # options: [always|never|change] default: always
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -360,3 +360,7 @@ Below is a screenshot of this module's tests running in [Wallaby](https://wallab

![redux-first-router wallaby tests screenshot](./tests-screenshot-2.png)

## More from FaceySpacey in Reactlandia
- [react-universal-component](https://github.com/faceyspacey/react-universal-component). It's made to work perfectly with *Redux First Router*. Together they comprise our *"frameworkless"* Redux-based approach to what Next.js does (splitting, SSR, prefetching, and routing).
- [webpack-flush-chunks](webpack-flush-chunks). And this is the foundation of our `Universal` product line. Make sure to check out!

1 change: 1 addition & 0 deletions __test-helpers__/reducerParameters.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export default (type, pathname) => {

initialState: getInitialState(
prev.pathname,
{},
prev.type,
prev.payload,
routesMap,
Expand Down
28 changes: 26 additions & 2 deletions __test-helpers__/setup.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { applyMiddleware, createStore, compose } from 'redux'
import createHistory from 'history/createMemoryHistory'
import connectRoutes from '../src/connectRoutes'

export default (
const setup = (
path = '/',
options = { title: 'title', location: 'location' }
) => {
Expand All @@ -17,5 +18,28 @@ export default (
keyLength: 6
})

return connectRoutes(history, routesMap, options)
const tools = connectRoutes(history, routesMap, options)
return { ...tools, routesMap }
}

export default setup

export const setupAll = (path, options, rootReducer, preLoadedState) => {
const tools = setup(path, options)
const { middleware, reducer, enhancer } = tools
const middlewares = applyMiddleware(middleware)
const enhancers = compose(enhancer, middlewares)

rootReducer =
rootReducer ||
((state = {}, action = {}) => ({
location: reducer(state.location, action),
title: action.type
}))

const store = createStore(rootReducer, preLoadedState, enhancers)
return {
...tools,
store
}
}
Loading

0 comments on commit 2456517

Please sign in to comment.