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

Support swift concurrency #3

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Support swift concurrency #3

wants to merge 3 commits into from

Conversation

tokijh
Copy link
Owner

@tokijh tokijh commented Nov 5, 2022

Now we can use Swift Concurrency 🙌 (#1)

How to use?

@AsyncStubProxy(fetch) var fetchStub
func fetch() async -> String { 
  await fetchStub.invoke(default: "")
}

- - - - -

let convertStubStore = StubStore()
func convert<Source, Target>(_ source: Source) async -> Target {
  let stub = convertStubStore.asyncStub(arguments: Source.self, result: Target.self)
  return await stub.invokeWithoutDefault(value)
}

Unfortunately, I couldn't find a way to provide it with the same interface 😢

@tokijh tokijh force-pushed the issue/#1 branch 7 times, most recently from cc4cccb to 72448f1 Compare November 5, 2022 21:02
Include Xcode 13.2.1 to test the case where swift concurrency is not supported.
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.

1 participant