Skip to content

Proposal: change custom dispatcher signature #68

Closed
@gaearon

Description

@gaearon

As rightly noted by @vslinko, it's better to provide getState instead of initialState.

I think I was wrong now when I said this. In fact, I find it now easier to implement composable dispatchers only if each “parent” has the ability to “intercept” both getState and setState, and if the child can “query” the latest state.

I'm going to keep this open for a while, as I'm still not 100% sure which approach is more correct, but I'm leaning towards (getState, setState) => action => () now as the signature for the dispatcher.

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