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

[bugfix] change function overload order in Form typescript define #12538

Merged
merged 1 commit into from Oct 8, 2018

Conversation

Projects
None yet
2 participants
@TomIsion
Contributor

TomIsion commented Oct 8, 2018

When I use with Form.create()() and this.props.form.validateFields with async/await in typescript:

this.prop.form.validateFields(async (errors, values) {
  // code here
  // writing sth need to block
  const a = await getInfo();
})

tslint always tell me: [ts] Parameter 'errors' implicitly has an 'any' type.

In typescript, async/await callback will conform these after typescript overload define:

validateFields(options: Object): void;
validateFields(callback: ValidateCallback): void;

The async/await func should use callback define firstly. Just like the above define in Form.d.ts:

validateFields(fieldNames: string[], callback: ValidateCallback): void;
validateFields(fieldNames: string[], options: Object): void;

So I change the order of the function overload define.

@codecov

This comment has been minimized.

codecov bot commented Oct 8, 2018

Codecov Report

Merging #12538 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #12538   +/-   ##
=======================================
  Coverage   92.33%   92.33%           
=======================================
  Files         211      211           
  Lines        5542     5542           
  Branches     1599     1599           
=======================================
  Hits         5117     5117           
- Misses        419      421    +2     
+ Partials        6        4    -2
Impacted Files Coverage Δ
components/form/Form.tsx 95% <ø> (ø) ⬆️
components/transfer/index.tsx 87.91% <0%> (ø) ⬆️
components/time-picker/index.tsx 81.96% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5bef1aa...e9c76f3. Read the comment docs.

@afc163 afc163 merged commit 4d48641 into ant-design:master Oct 8, 2018

18 checks passed

WIP ready for review
Details
ci/circleci: compile Your tests passed on CircleCI!
Details
ci/circleci: dist Your tests passed on CircleCI!
Details
ci/circleci: lint Your tests passed on CircleCI!
Details
ci/circleci: setup Your tests passed on CircleCI!
Details
ci/circleci: test_dist Your tests passed on CircleCI!
Details
ci/circleci: test_dist_15 Your tests passed on CircleCI!
Details
ci/circleci: test_dom Your tests passed on CircleCI!
Details
ci/circleci: test_dom_15 Your tests passed on CircleCI!
Details
ci/circleci: test_es Your tests passed on CircleCI!
Details
ci/circleci: test_es_15 Your tests passed on CircleCI!
Details
ci/circleci: test_lib Your tests passed on CircleCI!
Details
ci/circleci: test_lib_15 Your tests passed on CircleCI!
Details
ci/circleci: test_node Your tests passed on CircleCI!
Details
ci/circleci: test_node_15 Your tests passed on CircleCI!
Details
codecov/patch Coverage not affected when comparing 5bef1aa...e9c76f3
Details
codecov/project 92.33% remains the same compared to 5bef1aa
Details
security/snyk - package.json (paranoidjk) No manifest changes detected

@afc163 afc163 referenced this pull request Oct 12, 2018

Merged

Add changelog of 3.10.1 #12615

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment