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

Silencing the warning #22

Merged
merged 1 commit into from Jul 31, 2018
Merged

Silencing the warning #22

merged 1 commit into from Jul 31, 2018

Conversation

nikans
Copy link
Contributor

@nikans nikans commented Jul 24, 2018

When there's no need to store the result of the last .on(:_,:_) function call, the warning is raised. Fixed that. Looks like in most cases this behaviour is more practical.

When there's no need to store the result of the last `.on(:_,:_)` function call, the warning is raised. Fixed that.
@totocaster
Copy link
Owner

Hi @nikans, thanks for submitting PR! Before we proceed, can I ask in what case do you get warnings that is not one of following?

  1. The .on(:_,:_) chain is not assigned to a variable, e.i. has no reference; or
  2. No .start() is called at the end of the chain or reference Typist object.

@nikans
Copy link
Contributor Author

nikans commented Jul 30, 2018

Hi @totocaster,
basically, both. I first assign an instance variable for Typist

let keyboard = Typist()

then configure the keyboard with code like this

keyboard
    .on(event: _) { ... }
    .on(event: _) { ... }

and then call .start() when the view is ready to listen for events.
Since .on(:_,:_) returns Self and it is non-discardable, a warning is raised.

@totocaster
Copy link
Owner

Gotcha, fair!

@totocaster totocaster merged commit db8887a into totocaster:master Jul 31, 2018
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.

None yet

2 participants