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

Add UniTask.WaitUntil overload which takes a target to avoid closure allocation #562

Closed
laicasaane opened this issue Apr 2, 2024 · 2 comments

Comments

@laicasaane
Copy link

laicasaane commented Apr 2, 2024

For the context of this proposal:
Since UniTask.WaitUntilValueChanged uses IEqualityComparer to detect if the value has changed, its logic is totally different from UniTask.WaitUntil. So I can't just replace WaitUntil with WaitUntilValueChanged.

My use case is:

var component = await UniTask.WaitUntil(gameObject, static x => x.GetComponent<MyComponent>());

// do something to the retrieved component
@neuecc
Copy link
Member

neuecc commented Apr 5, 2024

I think it's a good idea to add (TState, Func) overloads throughout.

@kochounoyume
Copy link
Contributor

I have implemented the suggested UniTask.WaitUntil, the adjacent UniTask.WaitWhile and also the overloading of UniTask.Defer, which I personally use frequently, and submitted a PR.

@neuecc neuecc closed this as completed Sep 30, 2024
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

No branches or pull requests

3 participants