Skip to content

jisaacks/redux-action-director

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Redux Action Director

A simple library to map routes to redux action creators.

Why?

First, I think react-router is awesome. However, when using the combination of react-router with redux and needing to fetch data based on route params and store that data in redux it can get a little hairy. This is a scenario they are still trying to figure out the best way to handle. Until then, this is a simple solution. It does not offer all the power of react-router and is not intended to. It simply provides an easy way to have routes trigger action creators.

It is actually a tiny wrapper around director that allows you to specify the action creators and it will dispatch them instead of just invoking them.

Usage

import { createRouter } from 'redux-action-director';
import { fetchPost } from './actions';
import store from './store';

export default createRouter(store, {
  "/posts/:id": fetchPost
});

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published