Skip to content

Commit

Permalink
Make optional arguments to initialize opional in flow (#3898)
Browse files Browse the repository at this point in the history
matching the documentation.

Fixes #3668
  • Loading branch information
aij authored and erikras committed Mar 9, 2018
1 parent 2811705 commit 085b218
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -289,8 +289,8 @@ const focus: Focus = (form: string, field: string): FocusAction => ({
const initialize: Initialize = (
form: string,
values: Object,
keepDirty: boolean,
otherMeta: Object = {}
keepDirty?: boolean | Object,
otherMeta?: Object = {}
): InitializeAction => {
if (keepDirty instanceof Object) {
otherMeta = keepDirty
Expand Down
7 changes: 6 additions & 1 deletion src/actions.types.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,16 @@ export type InitializeAction = {
payload: Object
} & Action
export type Initialize = {
(
form: string,
values: Object,
otherMeta?: Object
): InitializeAction,
(
form: string,
values: Object,
keepDirty: boolean,
otherMeta: Object
otherMeta?: Object
): InitializeAction
}
export type RegisterFieldAction = {
Expand Down

0 comments on commit 085b218

Please sign in to comment.