Skip to content

extend the H4R's createStore to accept a reducer function as the first argument #10

@shanebdavis

Description

@shanebdavis

The goal here is to allow people to incrementally convert an existing Redux project to H4R. To start, someone would just replace the Redux createStore with the H4R createStore. In order to do this, H4R's createStore needs to support the same API as Redux (it doesn't currently).

After solely replacing Redux's createStore with H4Rs, the rest of the project should still run and work unchanged. From there, the people doing the migration could incrementally either add createReduxModule calls for new slices or start replacing existing Redux state with createReduxModule.

Support this pattern:

import { setStore, createStore } from "hooks-for-redux";

export default setStore(createStore((state) => state));

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