Skip to content

[WIP] Redux House gives you a productive way to create Actions, Requests and Reducers

License

Notifications You must be signed in to change notification settings

marquesm91/redux-house

Repository files navigation

redux-house

Build Status codecov npm

Table of Contents

Installation

yarn add redux-house
# or
npm install --save redux-house

Documentation

createAction

import { createAction } from 'redux-house';

const setEmpty = createAction('SET_EMPTY');

const setUser = createAction('SET_USER', 'user');

const setToken = createAction('SET_TOKEN', 'token', value => `Bearer ${value}`);

setEmpty(); // { type: 'SET_EMPTY' }
setUser('Doug'); // { type: 'SET_USER', user: 'Doug' }
setToken('abc123'); // { type: 'SET_TOKEN', token: 'Bearer abc123' }

createActions

import { createActions } from 'redux-house';

const actions = createActions({
  SET_EMPTY: null,
  SET_USER: 'user', // or ['user']
  SET_TOKEN: ['token', value => `Bearer ${value}`],
});

actions.setEmpty(); // { type: 'SET_EMPTY' }
actions.setUser('Doug'); // { type: 'SET_USER', user: 'Doug' }
actions.setToken('abc123'); // { type: 'SET_TOKEN', token: 'Bearer abc123' }

About

[WIP] Redux House gives you a productive way to create Actions, Requests and Reducers

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published