Skip to content

Add createStoreWithMiddleware function #1236

Closed
@gajus

Description

@gajus

Most of the real life examples (and the official documentation) introduce an extra and unnecessary step of having to use applyMiddleware to create a function that is often named createStoreWithMiddleware (not to mention the awkward, variadic applyMiddleware syntax in the first place).

It would make sense to have a function createStoreWithMiddleware with API:

createStoreWithMiddleware(middlewares: Array<Function>, reducer, [initialState]): Object

that is equivalent to calling:

createStoreWithMiddleware = applyMiddleware(logger)(createStore);
store = createStoreWithMiddleware(todos, [ 'Use Redux' ]);

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions