Skip to content

Conversation

@DzmitryKharko
Copy link
Collaborator

WHAT Create sample for ControllersTree package

{
await UniTask.Yield();
if (cancellationToken.IsCancellationRequested)
{

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider throwing an operation cancelled exception simply passing CT into yield

/// RootLifetimeScope sets up the DI container for the game application, configuring essential components such as
/// the entry point (Bootstrap), controllers, and services. This setup ensures efficient dependency management and lifecycle handling during gameplay.
/// </summary>
public class RootLifetimeScope : LifetimeScope

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider not to use LifetimeScope cause it's tied to unity engine lifecycle. Try to keep control code centric.

protected override async UniTask OnFlowAsync(CancellationToken cancellationToken)
{
_view = await _factory.CreateAsync(_data.ResourceId, cancellationToken);
cancellationToken.ThrowIfCancellationRequested();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can safely remove all cancellationToken.ThrowIfCancellationRequested(), cause asynchronous operations you're using will throw an exception anyway

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.

3 participants