1.1.6 • Published 3 years ago

rxstore-react-router v1.1.6

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

RxStore React Router

This is the official React Router bindings for React RxStore Observer.

This project is currently in development.

Usage:

import { createRouterObserver, push, routerReducer } from 'rxstore-react-router'
import { createRxStore, combineReducers } from 'rxstore-observer'
import { BrowserRouter as Router } from 'react-router-dom'
import { Switch, Route } from 'react-router'
import { Path1, Path2 } from './components'
import storeReducer from './reducer'

const store = createRxStore( combineReducers({ main: storeReducer, route: routerReducer }) )

const RouterObserver = createRouterObserver(store)

const YourAwesomeApp = () => {
    return (
        <Router>
            <RouterObserver>
                <Switch>
                    <Route path="/path-1" exact={ true } component={ Path1 }/>
                    <Route path="/path-2" exact={ true } component={ Path2 }/>
                </Switch>
            </RouterObserver>
        </Router>
    )
}

store.dispatch( push('/path-2') ) // Calls history.push. Awesome!
1.1.6

3 years ago

1.1.5

3 years ago

1.1.4

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago