Skip to content

@cycle/state Reducer to expect defined state? #948

Description

@mightyiam

export type Reducer<T> = (state: T | undefined) => T | undefined;

Is this exported Reducer meant to be imported and used in apps? I find that in my app I would like to have a reducer type where state is always defined:

type Reducer<T> = (state: T) => T

Could we have a separate API for instantiating state, somehow, so that a Reducer could assume positive existence of state?

Activity

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