Skip to content

makeDuck should also return a resetReducer #12

@monteslu

Description

@monteslu

Instead of import { resetReducer } from cooldux :

export const { someAction, someOtherAction, initialStateCombined } = duck;

const reducer = resetReducer(initialStateCombined, (state = initialStateCombined, action) => {
  return duck.reducerCombined(state, action);
});

export default reducer;

It should be as simple as:

export const { someAction, someOtherAction } = duck;

export default duck.resetReducer;

you can still the former example if you need custom reducer functionality. Just finding myself using the same reset pattern too often

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