-
Notifications
You must be signed in to change notification settings - Fork 0
integrated skie to HomeComponent #15
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
base: task/UPUP-581/update-libraries
Are you sure you want to change the base?
integrated skie to HomeComponent #15
Conversation
| } | ||
|
|
||
| @MainActor | ||
| func activate() async { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Не очень удобно, что нужно вызывать activate вручную. Можно забыть про него.
нельзя ли сделать этот метод activate приватным и вызвать его в init?
| struct PokemonDetailsView: View { | ||
| @ObservedObject private var pokemonState: ObservableState<LoadableState<DetailedPokemon>> | ||
| @ObservedObject private var voteState: ObservableState<PokemonVoteState> | ||
| @ObservedObject private var voteState: ObservableState<__PokemonVoteState> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Это то, про что ты писал в доке?
Например Generic c enum вернет ResultWrapper<__Foo>
Почему так происходит?
| PokemonDetailsBodyView( | ||
| pokemon: pokemon, | ||
| voteState: voteState.value, | ||
| voteState: voteState.value as PokemonVoteState, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Получается, мы тут кастим __PokemonVoteState к PokemonVoteState?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
да, __PokemonVoteState - это обычный класс от котлина, который имитирует enum. Он нужен что бы мы могли его использовать в дженерике ObservableState
А дальше для удобства использования его кастим к PokemonVoteState, который уже является swift enum
| interface HomeComponent { | ||
|
|
||
| val childStack: CStateFlow<ChildStack<*, Child>> | ||
| @FlowInterop.Enabled |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Получается, мы должны явно указывать @FlowInterop.Enabled?
Можно ли сделать, чтоб он применялся автоматически к полям всех компонентов?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Есть глобальный конфиг, он указывается в gradle, а есть локальные конфиги, они указываются с помощью аннотаций и перезаписывают глобальный конфиг для конкретного элемента.
Если в глобальном конфиге указать что FlowInterop включен, то эти аннотации не будут нужны. Аналогично и с остальными фичами
Здесь я отключил глобально фичи, что бы можно было на отдельных кусках кода показать возможности и не приходилось править весь остальной код
| self.childStack = ObservableStateFlow(flow: component.childStack) | ||
| Task.init { [self] in | ||
| await self.childStack.activate() | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Мы тут запускаем Task. Это что-то вроде корутины? А когда она отменится?
| let pokemonName = dialogComponent?.dialogData.value.pokemonName ?? .empty | ||
|
|
||
| return MR.strings().pokemons_dialog_title.format(args_: [pokemonName]).localized() | ||
| return MR.strings().pokemons_dialog_title.format(args: [pokemonName]).localized() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
args_ -> args
Это из-за SKIA так? Или что-то в Моко поменялось?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Да, это как раз таки одна из фичей, которая улучшает нейминг параметров
Произведена точечная миграция на skie.
Использовались следующие фичи: