Skip to content

Commit

Permalink
add eslint, configure with airbnb styles with a couple of minor overr…
Browse files Browse the repository at this point in the history
…ides, hook into build process, make our current stuff compliant
  • Loading branch information
Shane Gibbons committed Jan 20, 2018
1 parent ba7285c commit ceb61ea
Show file tree
Hide file tree
Showing 6 changed files with 710 additions and 36 deletions.
11 changes: 11 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module.exports = {
"extends": "airbnb-base",
"env": {
"browser": true,
"jest": true,
},
"rules": {
"import/prefer-default-export": false,
"quotes": ["error", "double"],
}
};
16 changes: 11 additions & 5 deletions docs/_docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,27 @@ redirect_from: /docs/api.html

Creates a new router, given a reference to the redux store for action dispatch

Currently only supports the interceptLinks property.

**Parameters:**

* `store` — object — Your redux store.
* `config` — object — Additional configuration parameters. Currently only supports the interceptLinks property.
* `config` — object — Additional configuration parameters.

### `route(pathOrPaths, handler)`

Registers a new route.

The path of paths that will trigger the handler.
A path can be of the form /foo/{bar}/{baz} to match
the bar param and baz param.
((bar, baz) => { } for the example above),
and returns a Redux action.

**Parameters:**

* `pathOrPaths` — string — (Optionally an array of strings) The path of paths that will trigger the handler. A path can be of the form /foo/{bar}/{baz} to match the bar param and baz param.
* `handler` — string — A handler that takes the params matched in the URL ((bar, baz) => { } for the example above), and returns a Redux action.
* `pathOrPaths` — string — (Optionally an array of strings)
* `handler` — string — A handler that takes the params matched in the URL

### `navigate(path, handler = () =>`

Expand All @@ -35,13 +41,13 @@ Searches for a matching path, and if it finds one, runs the associated handlers.
**Parameters:**

* `path` — string — The path to which to navigate.
* `handler` — object — (Optional) An additional handler to run after the standard handler does its thing.
* `handler` — object — (Optional) An additional handler to run after the standard handler.

### `prettify(path, title)`

Updates the path and, optionally, the title of the page without firing any handlers. This will be a purely aesthetic update to the location, and won't affect navigation / history.

*** Disabled eslint rule that tries to force this to be static because the router should be singleton.

**Parameters:**

* `path` — string — The new path.
Expand Down
Loading

0 comments on commit ceb61ea

Please sign in to comment.