Skip to content

Commit

Permalink
Readme cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
domn1995 committed Sep 22, 2022
1 parent 4fd2354 commit 9c9220c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,14 +141,15 @@ partial record Choice
// Program.cs
using Core;
using static Core.Choice;

// 2. Define async methods like you would for any other type.
static async Task<Choice> AskAsync()
{
// Simulating network call.
await Task.Delay(1000);

// 3. Return unions from async methods as you'd return any other type.
// 3. Return unions from async methods like any other type.
return new No("because I don't wanna!");
}

Expand All @@ -159,7 +160,7 @@ Console.WriteLine(response); // Prints "No, because I don't wanna!" after 1 seco
```

> **Note**:
> `MatchAsync()` can only be generated for namespace unions.
> `MatchAsync()` can only be generated for namespaced unions.
## Nested Union Support

Expand Down

0 comments on commit 9c9220c

Please sign in to comment.