Skip to content

Public sealed scope state#21

Closed
wupididu wants to merge 6 commits intomainfrom
public_sealed_scope_state
Closed

Public sealed scope state#21
wupididu wants to merge 6 commits intomainfrom
public_sealed_scope_state

Conversation

@wupididu
Copy link
Collaborator

@wupididu wupididu commented May 15, 2025

Сейчас невозможно проверить статус создания/удаления скоупа. Поэтому экспортируем ScopeState, который отражает состояние скоупа.


I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=ru

@wupididu wupididu requested a review from kltsv May 15, 2025 11:46
@wupididu wupididu force-pushed the public_sealed_scope_state branch from e893b6b to a0e5567 Compare May 15, 2025 11:49
@wupididu wupididu self-assigned this May 15, 2025
@wupididu wupididu added the new api Adding new API for the library label May 15, 2025
@kltsv kltsv mentioned this pull request May 15, 2025
@kltsv kltsv added this to the v1.1.0 milestone May 15, 2025
emitImmediately: emitImmediately,
);

/// Subscribes to the state.
Copy link
Collaborator

Choose a reason for hiding this comment

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

В доку к обычному listen стоит добавить, что он будет эмитить значение только на полное появление и исчезание скоупа, а в listenState — что будет эмитить на каждую смену состояния, можно так же сослаться на класс состояния.

if (scope == null) {
throw ScopeError(
'$Container must not be null if scope state is $_scopeState',
'$Container must not be null if scope state is $state',
Copy link
Collaborator

Choose a reason for hiding this comment

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

У стейта toString не переопределен, стоит это сделать, иначе тут будет некрасивый лог.

@wupididu wupididu force-pushed the public_sealed_scope_state branch from 0a86bef to 69e1d70 Compare May 26, 2025 14:56
@wupididu wupididu closed this Jun 5, 2025
@wupididu
Copy link
Collaborator Author

wupididu commented Jun 5, 2025

#22

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new api Adding new API for the library

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants