@k-ramel/driver-redux-little-router

redux-little-router driver for k-ramel

Stats

StarsIssuesVersionUpdatedCreatedSize
@k-ramel/driver-redux-little-router
20381.2.03 years ago4 years agoMinified + gzip package size for @k-ramel/driver-redux-little-router in KB

Readme

@k-ramel/driver-redux-little-router

redux-little-router driver for k-ramel

Examples

In a reaction (See main documentation about listeners/reactions)

Declare it in your store :

import driver from '@k-ramel/driver-redux-little-router'

const router = driver({ routes }, state => state.router, 'router')

createStore(
  {
    // your usual definition
  },
  {
    drivers: { router },
  },
)

In your reaction :

export const onUserLoggedIn = (store, action, drivers) => {
  const { router } = drivers
  // get userId in route params
  const userId = router.getRouteParam('userId')
  // dispatch push action to go to the new route
  router.push(`/user/${userId}`)
}

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.