Skip to content

QML: Add declarative API for awaiting a task#170

Merged
danvratil merged 2 commits intoqcoro:mainfrom
jbruechert:feature/declarative-task
Apr 24, 2023
Merged

QML: Add declarative API for awaiting a task#170
danvratil merged 2 commits intoqcoro:mainfrom
jbruechert:feature/declarative-task

Conversation

@jbruechert
Copy link
Contributor

This is a proposal for a bit nicer API for awaiting. In exchange for being a bit heavier, it allows declarative usage.

@jbruechert jbruechert force-pushed the feature/declarative-task branch 3 times, most recently from d54a502 to 5922757 Compare April 23, 2023 08:14
@danvratil
Copy link
Collaborator

Oooo, that is super-clever! I love it!

Do you think there's a use-case for an optional default "awaiting" value?

e.g.:

Label {
    text: api.name().await("Loading name...").value
}

Where the value of the value property would be "Loading ..." until the async task actually finishes and provides an actual value?

@jbruechert
Copy link
Contributor Author

Do you think there's a use-case for an optional default "awaiting" value?

That looks like a very good idea!

@jbruechert jbruechert force-pushed the feature/declarative-task branch from 5922757 to 474b7df Compare April 24, 2023 09:16
@jbruechert jbruechert force-pushed the feature/declarative-task branch from 38ba13c to 141219e Compare April 24, 2023 10:50
Copy link
Collaborator

@danvratil danvratil left a comment

Choose a reason for hiding this comment

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

Awesome! Great work. Thanks a lot!

@danvratil danvratil merged commit cb8f033 into qcoro:main Apr 24, 2023
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