Skip to content

Allow chaining of methods for more concise code #809

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 1 commit into from
Nov 6, 2017

Conversation

0xPIT
Copy link
Contributor

@0xPIT 0xPIT commented Nov 4, 2017

This change allows chaining of methods for more concise code, similar like in most JavaScript Frameworks. Should not affect previous usage patterns, as the return type was void.

The BasicOTA example could look like this:

 ArduinoOTA
    .onStart([]() {
      
    })
    .onEnd([]() {

    })
    .onProgress([](unsigned int progress, unsigned int total) {

    })
    .onError([](ota_error_t error) {
      
    });

@me-no-dev me-no-dev merged commit 7890e11 into espressif:master Nov 6, 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.

2 participants