#948·cyclejs

@cycle/state Reducer to expect defined state?

Author: mightyiamCreated Aug 28, 2020Updated Sep 14, 2020

https://github.com/cyclejs/cyclejs/blob/313762d9beb87e099bb36511875c42bd7e1ff980/state/src/types.ts#L2

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:

typescript
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?