Skip to content

Add possibility to create reducer #3

Open

Description

@Flixow

As a user, I can create reducer via cli rdc reducer <name> command.

reducers/{name}.js

const INITIAL_STATE = {
};

export default (state = INITIAL_STATE, action) => {
  switch(action.type) {
    default:
      return state;
  }
};

reducers/index.js


import { combineReducers } from 'redux';

import {name} from './{name}';

const rootReducer = combineReducers({
  {name}
});

export default rootReducer;

@marian79 @gh3r @hwesol13 comments?

Activity

  1. gh3r commented on Sep 26, 2018

    @gh3r

    @Flixow Not sure about initial state, as you are creating it as an object and then assigning whole as state.

  2. Flixow commented on Sep 27, 2018

    @Flixow
    ContributorAuthor

    @gh3r All of my reducers provide objects to the store. Do you mean that reducer might not be an object?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions