8000 feat(change): function supported for change action by caosm · Pull Request #4 · caicloud/redux-form · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat(change): function supported for change action #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 16, 2018

Conversation

caosm
Copy link
@caosm caosm commented Aug 15, 2018

What this PR does / why we need it:

  • change 支持传入函数

change(fieldName, (fieldValue, allValue) => {})

示例:

{
  "metadata": {
     name: "a",
     alias: "n",
     createTime: "",
     endTime: ""
  }
}

before:

this.props.change("metadata.name", "hello");
this.props.change("metadata.alias", "world");

after:

this.props.change("metadata", metadata => ({
  ...metadata,
  name: "hello"
}));

Which issue(s) this PR fixes (optional, close the issue(s) when PR gets merged):

Fixes #

Special notes for your reviewer:

/cc @your-reviewer

Release note:

NONE

@caicloud-bot caicloud-bot added release-note-none Denotes a PR that doesn't merit a release note. caicloud-cla: yes Indicates the PR's author has not signed the Caicloud CLA. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Aug 15, 2018
Copy link
@xu-ai-liang xu-ai-liang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@caicloud-bot caicloud-bot added the lgtm Indicates that a PR is ready to be merged. label Aug 15, 2018
@caosm
Copy link
Author
caosm commented Aug 16, 2018

/approve

@caicloud-bot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: caosm, xu-ai-liang
To fully approve this pull request, please assign additional approvers.
We suggest the following additional approvers:

Assign the PR to them by writing /assign in a comment when ready.

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@caosm caosm merged commit d9fdab9 into caicloud:caicloud-7.2.1 Aug 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
caicloud-cla: yes Indicates the PR's author has not signed the Caicloud CLA. lgtm Indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0