Skip to content
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

Remove unnecessary type casting in examples #221

Merged
merged 2 commits into from
Jun 6, 2017
Merged

Remove unnecessary type casting in examples #221

merged 2 commits into from
Jun 6, 2017

Conversation

bitpshr
Copy link
Member

@bitpshr bitpshr commented Jun 5, 2017

Type: feature

The following has been addressed in the PR:

  • There is a related issue
  • All code matches the style guide
  • Unit or Functional tests are included in the PR

Description:

This PR removes once-necessary type casting from examples. The issue was evident when grabbing values from state and passing them to child components as properties.

Resolves #217

@bitpshr bitpshr requested review from tomdye and smhigley June 5, 2017 14:58
@codecov
Copy link

codecov bot commented Jun 5, 2017

Codecov Report

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

Impacted file tree graph

@@          Coverage Diff           @@
##           master    #221   +/-   ##
======================================
  Coverage    99.1%   99.1%           
======================================
  Files          19      19           
  Lines        1000    1000           
  Branches      300     300           
======================================
  Hits          991     991           
  Misses          1       1           
  Partials        8       8

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 cc01318...f78833d. Read the comment docs.

open: this.state.open,
underlay: this.state.underlay,
align: this.state.align,
onRequestClose: () => this.setState({ open: false }),
Copy link
Member

Choose a reason for hiding this comment

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

this doesn't actually return anything so shouldn't be inline

Copy link
Member

Choose a reason for hiding this comment

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

I see it is done elsewhere also, I think the style guide also says that if there is no return then the implicit return shouldn't be used.

Copy link
Member

@agubler agubler left a comment

Choose a reason for hiding this comment

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

Seems cool, just a small query

onChange: (option: OptionData) => {
this.setState({ value2: option.value });
}
onChange: (option: OptionData) => this.setState({ value2: option.value })
Copy link
Contributor

Choose a reason for hiding this comment

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

Same comment as @agubler made below about not using implicit return

Copy link
Contributor

@smhigley smhigley left a comment

Choose a reason for hiding this comment

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

Looks good! Just the questions about implicit return and the currently-still-exported types.

@@ -31,49 +31,49 @@ export class App extends AppBase<WidgetProperties> {
w(TextInput, {
key: 't1',
label: 'Name',
type: <TextInputType> 'text',
type: 'text',
Copy link
Contributor

Choose a reason for hiding this comment

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

Do things like ButtonType and TextInputType still need to be exported now that we don't need to do this?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think they should still be made available to downstream users.

@bitpshr
Copy link
Member Author

bitpshr commented Jun 5, 2017

@smhigley @agubler updated all examples to not implicitly return.

Copy link
Contributor

@smhigley smhigley left a comment

Choose a reason for hiding this comment

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

Cool, looks good to me!

@bitpshr bitpshr merged commit 35ead3f into dojo:master Jun 6, 2017
@bitpshr bitpshr deleted the example-cleanup branch June 6, 2017 14:29
@dylans dylans added this to the 2017.06 milestone Jun 6, 2017
@kitsonk kitsonk mentioned this pull request Oct 30, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants