# @rtobon/tango-router

> Dead simple router for @rtobon/tango

Latest version **1.4.1** (published 2018-02-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install @rtobon/tango-router
pnpm add @rtobon/tango-router
yarn add @rtobon/tango-router
bun add @rtobon/tango-router
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.4.1 |
| Published | 2018-02-12 |
| First published | 2018-02-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 5 |
| Unpacked size | 19.7 KB |
| Known vulnerabilities | 0 (+3 in 1 direct dependencies) |
| Install scripts | no |
| Author | Oleg Orlov |
| Maintainers | rtobon |

## Links

- npm: https://www.npmjs.com/package/@rtobon/tango-router
- Repository: https://github.com/rtobon/tango-router
- Homepage: https://github.com/rtobon/tango-router#readme
- Issues: https://github.com/rtobon/tango-router/issues
- npm.io page: https://npm.io/package/@rtobon/tango-router

## Dependencies (5)

- [immutable](https://npm.io/package/immutable.md) 3.8.1
- [invariant](https://npm.io/package/invariant.md) 2.2.1
- [react-router](https://npm.io/package/react-router.md) 2.8.1
- [react-router-redux](https://npm.io/package/react-router-redux.md) 3.0.0
- [react-router-scroll](https://npm.io/package/react-router-scroll.md) 0.3.3

## Recent versions

- 1.4.1 (latest) — 2018-02-12
- 1.4.0 — 2018-02-09

## README

# @eagle/tango-router

> Dead simple router for @rtobon/tango

Wraps react-router + react-router-redux and provides the simplest API possible. Built for @eagle/tango, but will work in any redux application.

## Install

```
npm install --save @rtobon/tango-router
```

## Repository

https://github.com/rtobon/tango-router.git

## Get Started

- Import in the module
- Add it to your store's plugins
- Router state is now under `router` in your store

### Example

```js
import { createStore } from '@rtobon/tango'
import * as router from '@rtobon/tango-router'

// you get the point
let store = createStore({
  plugins: [ router ]
})
```

## API

- history
- actions
- reducers
- middleware
- hook

### Components

These are all re-exported from react-router, the behavior is exactly the same. See the [react-router documentation](https://github.com/reactjs/react-router/tree/master/docs) if you haven't used these before.

- Router
- Route
- Link
- Redirect
- IndexRoute
- IndexLink
- IndexRedirect

#### Auth

   handling authentication

##### Props

- `store` - Redux store
- `options` - Options Object

##### Options Object Keys

- `authSelector(state): authData` \(*Function*): A state selector for the auth data.
- `redirectAction` \(*Function*): action for redirecting the user.
- `[failureRedirectPath]` \(*String*): Optional path to redirect the browser to on a failed check. Defaults to `/login`
- `[predicate(authData): Bool]` \(*Function*): Optional function to be passed the result of the `authSelector` param.
If it evaluates to false the browser will be redirected to `failureRedirectPath`.
- `[allowRedirectBack]` \(*Bool*): Optional bool on whether to pass a `redirect` query parameter to the `failureRedirectPath`

---
_Source: https://npm.io/package/@rtobon/tango-router · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
