Skip to content

Conversation

TheCrossBoy
Copy link

@TheCrossBoy TheCrossBoy commented Apr 17, 2025

ToCoroutine<T>() provides an excellent way to port existing synchronous calls to asynchronous without needing to fully rewrite everything - when inside a coroutine, it can be yielded instead.

To get the value that the previously-synchronous function would have returned, you use .Current. Right now, Current is an object, when it should be a T. I think this might have been to avoid problems with non-nullable / reference types, so I wrapped it in Nullable (with T?).

Eliminates extra unnecessary typecasting with this.

@TheCrossBoy TheCrossBoy changed the title Update ToCoroutineEnumerator<T> to return a T from Current instead of object Update ToCoroutineEnumerator<T> to return a T? from Current instead of object Apr 17, 2025
Copy link
Contributor

This PR is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 30 days.

@github-actions github-actions bot added the stale label Oct 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant