Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Support async delegates for WaitFor* #1822

Copy link
Copy link

Description

@radmorecameron
Issue body actions

Is the feature request related to a problem? Please elaborate.

Yes, some of our state checking logic involves invoking an async method.

** A clear and concise description of what the problem is. **
WaitForStateAsync (and all other WaitFor*Asyncs) don't support async lambdas.

The suggested solution

Allow passing a Func<bool, Task> so async lambda can be used.

Additional Context
Minimum repro:

var myCut = RenderComponent<MyComponent>();
await myCut .WaitForStateAsync(async () => {
    return await myCut .CheckStateAsync();
});

// MyComponent

<div>
</div>
@code {
   public async Task<boolean> CheckStateAsync() {
     // async state checking code
   }
}
Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.