Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds better Flow support. Now, if the return type of the recipe never returns `undefined`, it can be guaranteed that `produce` won't return `undefined`. This allows compatibility with other types, like Redux's `Reducer` type. i.e., ```js type Reducer<S, A> = (S | void, A) => S declare var reducer: Reducer<State, Action> // This is now possible! Before it would fail, as the return type of // produce would be `State | void`. const initialState: State = produce(reducer)(undefined, action) ```
- Loading branch information
1 parent
76b12cf
commit 204d3c5
Showing
1 changed file
with
33 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters