{"id":370340,"date":"2024-05-21T04:23:01","date_gmt":"2024-05-21T04:23:01","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=370340"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=370340","title":{"rendered":"<span>\u0412\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0438 Modo \u0432 \u043c\u043d\u043e\u0433\u043e\u043c\u043e\u0434\u0443\u043b\u044c\u043d\u044b\u0439 Compose \u043f\u0440\u043e\u0435\u043a\u0442<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0432\u044b \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u0435\u0441\u044c \u0441 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0435\u0439 \u0434\u043b\u044f Android.<\/p>\n<p>\u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0432 \u043c\u043d\u043e\u0433\u043e\u043c\u043e\u0434\u0443\u043b\u044c\u043d\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435. \u0415\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0443\u0437\u043d\u0430\u0442\u044c \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u044f \u044d\u0442\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u0442\u043e \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043c\u043e\u0436\u043d\u043e <a href=\"https:\/\/github.com\/terrakok\/Modo\" rel=\"noopener noreferrer nofollow\">\u0443\u0437\u043d\u0430\u0442\u044c \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438<\/a>.<\/p>\n<h2>\u041d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u0440\u043e UDF<\/h2>\n<p>\u0414\u043b\u044f \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u043c\u0441\u044f \u0441 UDF. <\/p>\n<p>UDF \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0447\u0430\u0441\u0442\u0435\u0439<\/p>\n<ul>\n<li>\n<p><code>State<\/code> &#8212; \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u043f\u0440\u0430\u0432\u0434\u044b \u0438\u043b\u0438 \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438<\/p>\n<\/li>\n<li>\n<p><code>View<\/code> &#8212; UI \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 <code>State<\/code><\/p>\n<\/li>\n<li>\n<p><code>Action<\/code> &#8212; \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u0435\u043d\u044f\u044e\u0442 <code>State<\/code><\/p>\n<\/li>\n<\/ul>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/c76\/80d\/145\/c7680d145342b17aac5ed4c61ffef5c2.png\" alt=\"UDF\" title=\"UDF\" width=\"876\" height=\"816\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/c76\/80d\/145\/c7680d145342b17aac5ed4c61ffef5c2.png\"\/><\/p>\n<div><figcaption>UDF<\/figcaption><\/div>\n<\/figure>\n<p>\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f UDF, \u044d\u0442\u043e \u043a\u043e\u0433\u0434\u0430 <code>Action<\/code> \u043c\u0435\u043d\u044f\u0435\u0442 <code>State<\/code>, \u0430 <code>View<\/code> \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 <code>State<\/code>. <\/p>\n<p>\u0411\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043f\u0440\u043e UDF \u043c\u043e\u0436\u043d\u043e <a href=\"https:\/\/developer.android.com\/jetpack\/compose\/architecture#udf\" rel=\"noopener noreferrer nofollow\">\u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0437\u0434\u0435\u0441\u044c<\/a>.<\/p>\n<h2>\u0417\u043d\u0430\u043a\u043e\u043c\u0441\u0442\u0432\u043e \u0441 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439<\/h2>\n<p> Modo &#8212; \u044d\u0442\u043e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0438 \u0434\u043b\u044f Android, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0430 \u043d\u0430 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0430\u0445 UDF.\u00a0<\/p>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 \u0441\u043f\u0438\u0441\u043e\u043a \u044d\u043a\u0440\u0430\u043d\u043e\u0432 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u043a\u0430\u043a <code>List<\/code> \u0432 <code>State<\/code><\/p>\n<pre><code class=\"kotlin\">data class StackState(    val stack: List&lt;Screen> = emptyList(), )<\/code><\/pre>\n<p>\u0418 \u0435\u0441\u0442\u044c \u044d\u043a\u0448\u0435\u043d\u044b:<\/p>\n<pre><code class=\"kotlin\">class Forward(val screen: Screen, vararg val screens: Screen) : NavigationAction class Replace(val screen: Screen, vararg val screens: Screen) : NavigationAction class NewStack(val screen: Screen, vararg val screens: Screen) : NavigationAction class BackTo(val screen: Screen) : NavigationAction ...<\/code><\/pre>\n<p>\u041d\u0430 \u044d\u0442\u043e \u043c\u043e\u043c\u0435\u043d\u0442\u0435 \u043c\u043e\u0436\u043d\u043e \u0443\u0436\u0435 \u043f\u043e\u043d\u044f\u0442\u044c \u0440\u0430\u0437 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0430 \u043d\u0430 UDF, \u0442\u043e <code>Action<\/code> \u043c\u0435\u043d\u044f\u0435\u0442 <code>State<\/code>, \u0430 <code>State<\/code> \u043c\u0435\u043d\u044f\u0435\u0442 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u044d\u043a\u0440\u0430\u043d\u043e\u0432. <\/p>\n<h2>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u044e<\/h2>\n<p>\u0427\u0430\u0441\u0442\u043e \u0432 \u043c\u043d\u043e\u0433\u043e\u043c\u043e\u0434\u0443\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445 \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u0443\u044e \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u044e. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043b\u0438\u0431\u043e \u043a\u043e\u0440\u043d\u0435\u0432\u0443\u044e \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u044e, \u043b\u0438\u0431\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u044e \u0444\u0438\u0447\u0438.<\/p>\n<p>\u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u043b\u044f \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0438 \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u0440\u043e\u0434\u0443\u0431\u043b\u0438\u0440\u0443\u0435\u043c \u044d\u043a\u0448\u0435\u043d\u044b Modo<\/p>\n<pre><code class=\"kotlin\">interface NavigationAction   data class NavigationForward(val screen: Screen, val screens: List&lt;Screen> = emptyList()) :    NavigationAction   data class NavigationReplace(val screen: Screen, val screens: List&lt;Screen> = emptyList()) :    NavigationAction  ...<\/code><\/pre>\n<p>\u0417\u0430\u0442\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043c\u0430\u043f\u043f\u0435\u0440, \u0447\u0442\u043e\u0431\u044b \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0438\u0442\u044c \u043d\u0430\u0448\u0438 \u044d\u043a\u0448\u0435\u043d\u044b \u0432 \u044d\u043a\u0448\u0435\u043d\u044b Modo. <\/p>\n<pre><code class=\"kotlin\">fun NavigationContainer&lt;StackState>.navigate(command: NavigationCommand) {    val action = when (command) {        is NavigationSetStack -> SetStack(StackState(stack = command.screens))        is NavigationForward -> Forward(command.screen, *command.screens.toTypedArray())        ...<\/code><\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043a\u043b\u0430\u0441\u0441 \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0438, \u0433\u0434\u0435 \u043c\u044b \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u043d\u0430\u0448\u0438 \u044d\u043a\u0448\u0435\u043d\u044b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0435\u0442\u043e\u0434\u0430 <code>navigate(command: NavigationCommand)<\/code>  \u0438 \u0441\u043b\u0443\u0448\u0430\u0435\u043c \u043d\u0430\u0448\u0438 \u044d\u043a\u0448\u0435\u043d\u044b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>commandsFlow<\/code>. <\/p>\n<pre><code class=\"kotlin\">class Navigation {     private val _commandsFlow = Channel&lt;NavigationCommand>()      val commandsFlow: Flow&lt;NavigationCommand> = _commandsFlow.receiveAsFlow()      suspend fun navigate(command: NavigationCommand) {        _commandsFlow.send(command)    } } <\/code><\/pre>\n<p>\u041d\u0430 \u044d\u0442\u043e\u043c \u043f\u0440\u0438\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0435\u0439 \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u044e\u0442\u0441\u044f. <\/p>\n<h2>\u0421\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u044f \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0438 \u0441 \u044d\u043a\u0440\u0430\u043d\u043e\u043c<\/h2>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0447\u043d\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439 Dagger. <\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0432 \u0434\u0430\u0433\u0433\u0435\u0440-\u043c\u043e\u0434\u0443\u043b\u0435 \u043d\u0430\u0448\u0443 \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u044e. <\/p>\n<pre><code class=\"kotlin\">@Module internal class FeatureModule {     @Provides    @Singleton    @FeatureNavigationQualifier    fun provideNavigation(): Navigation = Navigation() }<\/code><\/pre>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0438 \u043f\u0440\u0438\u043a\u0440\u0435\u043f\u0438\u043c \u0435\u0433\u043e \u043a \u0434\u0430\u0433\u0433\u0435\u0440-\u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0435, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043d\u0430\u0448\u0435\u0439 \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0438.<\/p>\n<pre><code class=\"kotlin\">interface FeatureDependenciesProvider {      @FeatureNavigationQualifier    fun navigation(): Navigation }   internal interface FeatureComponent : FeatureDependenciesProvider<\/code><\/pre>\n<p>\u0417\u0430\u0442\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c <code>CompositionLocal<\/code> \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0438 \u0447\u0435\u0440\u0435\u0437 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441<\/p>\n<pre><code class=\"kotlin\">val LocalFeatureDependenciesProvider = compositionLocalOf&lt;FeatureDependenciesProvider> {    error(\"FeatureDependenciesProvider not found\") }<\/code><\/pre>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u044e \u0432 <code>ViewModel<\/code> \u0438 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0441\u043b\u0443\u0448\u0430\u0442\u0435\u043b\u044c \u044d\u043a\u0448\u0435\u043d\u043e\u0432 <code>navigationCommands<\/code>, \u0433\u0434\u0435 \u0432 UI \u044d\u0442\u0438 \u044d\u043a\u0448\u0435\u043d\u044b \u0443\u0436\u0435 \u0431\u0443\u0434\u0443\u0442 \u043c\u0430\u043f\u0438\u0442\u044c\u0441\u044f \u0432 Modo-\u044d\u043a\u0448\u0435\u043d\u044b<\/p>\n<pre><code class=\"kotlin\">internal class FeatureViewModel @Inject constructor(    @FeatureNavigationQualifier private val navigation: Navigation, ) : ViewModel() {      val navigationCommands: Flow&lt;NavigationCommand> = rootNavigation.commandsFlow } <\/code><\/pre>\n<p>\u0412 UI \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043b\u0430\u0441\u0441 <code>StackScreen<\/code> \u0438\u0437 Modo, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u0442 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u044d\u043a\u0440\u0430\u043d \u0438\u0437 stack \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0435\u0442\u043e\u0434\u0430 <code>TopScreenContent()<\/code> <\/p>\n<pre><code class=\"kotlin\">@Parcelize class FeatureStackScreen(    private val navigationModel: StackNavModel, ) : StackScreen(navigationModel = navigationModel) {      @Composable    override fun Content() {        val componentHolder = daggerViewModel {           ComponentHolder(DaggerFeatureComponent.builder().build())         }       val viewModel = daggerViewModel { componentHolder.component.viewModel() }        LaunchedEffect(Unit) {            viewModel.navigationCommands.collectLatest { command ->                navigate(command)            }        }        CompositionLocalProvider(            LocalFeatureDependenciesProvider provides componentHolder.component as FeatureDependenciesProvider        ) {      TopScreenContent()        }    } } <\/code><\/pre>\n<p>\u0433\u0434\u0435, \u044d\u0442\u043e\u0442 \u043a\u0443\u0441\u043e\u043a \u043a\u043e\u0434\u0430 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u043c\u0430\u043f\u043f\u0438\u043d\u0433 \u043d\u0430\u0448\u0435\u0433\u043e \u044d\u043a\u0448\u0435\u043d\u0430 \u0432 modo \u044d\u043a\u0448\u0435\u043d<\/p>\n<pre><code class=\"kotlin\">LaunchedEffect(Unit) {   viewModel.navigationCommands.collectLatest { command ->     navigate(command)   } }<\/code><\/pre>\n<p>\u0430 \u044d\u0442\u043e\u0442 \u043a\u0443\u0441\u043e\u043a \u043a\u043e\u0434\u0430 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e \u044d\u043a\u0440\u0430\u043d\u0430 \u0438\u0437 stack c \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0435\u0442\u043e\u0434\u0430 <code>TopScreenContent()<\/code> \u0438 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044f\u043c\u0438 \u0434\u0430\u0433\u0433\u0435\u0440-\u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b c \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>FeatureDependenciesProvider<\/code> <\/p>\n<pre><code class=\"kotlin\">CompositionLocalProvider(   LocalFeatureDependenciesProvider provides componentHolder.component as FeatureDependenciesProvider ) {     TopScreenContent()   }<\/code><\/pre>\n<p>\u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u0432\u044b\u0448\u0435\u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u0434\u043b\u044f \u0440\u0443\u0442\u043e\u0432\u043e\u0439 \u0438 \u0444\u0438\u0447\u0430 \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0438. \u041e\u0442\u043b\u0438\u0447\u0438\u0439 \u0432 \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u0438 \u0434\u043b\u044f \u0440\u0443\u0442\u043e\u0432\u043e\u0433\u043e \u0438 \u0444\u0438\u0447\u0430 \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0438 \u043d\u0435\u0442. \u0420\u0430\u0437\u0432\u0435 \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u0438\u0441\u0430\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u0435 \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u044b \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0438 \u0440\u0430\u0437\u043d\u044b\u0435 Qualifier \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0438\u0437 \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0438. <\/p>\n<h2>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0432 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0438<\/h2>\n<p>\u041d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043a\u043e\u0434\u0430  \u0434\u043b\u044f \u0440\u0430\u0437\u043d\u044b\u0445 \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0439 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u043e\u0442\u043b\u0438\u0447\u0438\u0439. \u0414\u0430\u0436\u0435 root \u0438 feature \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0438 \u0431\u0443\u0434\u0443\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e. \u042d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0432\u0441\u0435\u0433\u0434\u0430 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a. <\/p>\n<pre><code class=\"kotlin\">internal class FeatureViewModel @Inject constructor(    @FeatureNavigationQualifier private val navigation: Navigation,    private val screens: Screens, ) : ViewModel() {     init {      viewModelScope.launch {             rootNavigation.navigate(NavigationReplace(screens.someScreen()))         }    }    val navigationCommands: Flow&lt;NavigationCommand> = navigation.commandsFlow    fun onSomeActionHappened() {     navigation.navigate(NavigationReplace(screens.someScreen()))   } } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043c \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0434\u0432\u0443\u0445 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u0444\u0438\u0447\u0435\u0439 <code>Complex<\/code> \u0438 <code>Simple<\/code>, \u0433\u0434\u0435 \u0444\u0438\u0447\u0430 <code>Complex<\/code> \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0432\u043d\u0443\u0442\u0440\u0438 \u0441\u0435\u0431\u044f sub-feature. \u0410 \u0424\u0438\u0447\u0430 <code>Simple<\/code> \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0438\u0437 \u0441\u0435\u0431\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u044d\u043a\u0440\u0430\u043d. <\/p>\n<p>\u0413\u0434\u0435 \u0431\u0443\u0434\u0443\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0438:<\/p>\n<ol>\n<li>\n<p>Root Navigation &#8212; \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u044f \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u0444\u0438\u0447\u0435\u0439 <\/p>\n<\/li>\n<li>\n<p>Feature Navigation &#8212; \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u044f \u0444\u0438\u0447\u0435\u0439 Complex<\/p>\n<\/li>\n<\/ol>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/950\/2e8\/0d5\/9502e80d51b5f4ad53faebed8d347b7d.png\" width=\"2354\" height=\"1590\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/950\/2e8\/0d5\/9502e80d51b5f4ad53faebed8d347b7d.png\"\/><\/figure>\n<p>\u0415\u0441\u043b\u0438 \u0432 \u0442\u0430\u043a\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u043d\u0443\u0436\u043d\u043e \u0438\u0437 \u0444\u0438\u0447\u0438 <code>Complex<\/code> \u043e\u0442\u043a\u0440\u044b\u0442\u044c \u0444\u0438\u0447\u0443 <code>Simple<\/code>, \u0442\u043e \u0432 \u043d\u0430\u0448\u0435\u043c <code>ViewModel<\/code> \u0431\u0443\u0434\u0435\u0442 \u0434\u0432\u0430 \u043a\u043b\u0430\u0441\u0441\u0430 \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0438:<\/p>\n<ul>\n<li>\n<p> Root Navigation &#8212; \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043d\u0430 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0432\u044b\u0448\u0435 \u043d\u0430\u0448\u0435\u0433\u043e \u044d\u043a\u0440\u0430\u043d\u0430.<\/p>\n<\/li>\n<li>\n<p>Feature Navigation &#8212; \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u044f \u0444\u0438\u0447\u0438 <code>Complex<\/code><\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f, \u043a\u043e\u0433\u0434\u0430 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u0441\u044f \u044d\u043a\u0448\u0435\u043d \u043e\u0442\u043a\u0440\u044b\u0442\u0438\u044f \u0444\u0438\u0447\u0438 <code>Simple<\/code>, \u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0440\u0443\u0442\u043e\u0432\u0430\u044f \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u044f, \u0430 \u043d\u0435 \u0444\u0438\u0447\u043e\u0432\u0430\u044f \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u044f. <\/p>\n<pre><code class=\"kotlin\">internal class ComplexViewModel @Inject constructor(    @RootNavigationQualifier private val rootNavigation: Navigation,    @FeatureNavigationQualifier private val complex: Navigation,    private val rootScreens: RootScreens, ) : ViewModel() {    val navigationCommands: Flow&lt;NavigationCommand> = featureNavigation.commandsFlow    fun onSomeActionHappened() {     rootNavigation.navigate(NavigationReplace(rootScreens.simpleScreen()))   } }<\/code><\/pre>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<figure class=\"float full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/abd\/ccf\/b90\/abdccfb9010c6497f240f347c90a7d8d.gif\" width=\"862\" height=\"1732\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/abd\/ccf\/b90\/abdccfb9010c6497f240f347c90a7d8d.gif\"\/><\/figure>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438 \u043e\u0434\u0438\u043d \u0438\u0437 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 Modo \u0432 \u043c\u043d\u043e\u0433\u043e\u043c\u043e\u0434\u0443\u043b\u044c\u043d\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435. \u041c\u043e\u0436\u043d\u043e \u0434\u0430\u043b\u044c\u0448\u0435 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u0443\u044e \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u044e \u0441\u043d\u0438\u0436\u0430\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c \u043e\u0442 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0438\u043b\u0438 \u043c\u043e\u0436\u043d\u043e \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0430\u044f \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0441 Modo, \u043d\u0435 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u044f \u0441\u0432\u043e\u0438 \u043a\u043b\u0430\u0441\u0441\u044b. <a href=\"https:\/\/github.com\/dns21395\/ModoMultimodule\" rel=\"noopener noreferrer nofollow\">\u0422\u0430\u043a\u0436\u0435 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u043c \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u043d\u044b\u043c \u0432 \u0441\u0442\u0430\u0442\u044c\u0435<\/a>.<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/799033\/\"> https:\/\/habr.com\/ru\/articles\/799033\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0432\u044b \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u0435\u0441\u044c \u0441 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0435\u0439 \u0434\u043b\u044f Android.<\/p>\n<p>\u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0432 \u043c\u043d\u043e\u0433\u043e\u043c\u043e\u0434\u0443\u043b\u044c\u043d\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435. \u0415\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0443\u0437\u043d\u0430\u0442\u044c \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u044f \u044d\u0442\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u0442\u043e \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043c\u043e\u0436\u043d\u043e <a href=\"https:\/\/github.com\/terrakok\/Modo\" rel=\"noopener noreferrer nofollow\">\u0443\u0437\u043d\u0430\u0442\u044c \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438<\/a>.<\/p>\n<h2>\u041d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u0440\u043e UDF<\/h2>\n<p>\u0414\u043b\u044f \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u043c\u0441\u044f \u0441 UDF. <\/p>\n<p>UDF \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0447\u0430\u0441\u0442\u0435\u0439<\/p>\n<ul>\n<li>\n<p><code>State<\/code> &#8212; \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u043f\u0440\u0430\u0432\u0434\u044b \u0438\u043b\u0438 \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438<\/p>\n<\/li>\n<li>\n<p><code>View<\/code> &#8212; UI \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 <code>State<\/code><\/p>\n<\/li>\n<li>\n<p><code>Action<\/code> &#8212; \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u0435\u043d\u044f\u044e\u0442 <code>State<\/code><\/p>\n<\/li>\n<\/ul>\n<figure class=\"full-width\">\n<div><figcaption>UDF<\/figcaption><\/div>\n<\/figure>\n<p>\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f UDF, \u044d\u0442\u043e \u043a\u043e\u0433\u0434\u0430 <code>Action<\/code> \u043c\u0435\u043d\u044f\u0435\u0442 <code>State<\/code>, \u0430 <code>View<\/code> \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 <code>State<\/code>. <\/p>\n<p>\u0411\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043f\u0440\u043e UDF \u043c\u043e\u0436\u043d\u043e <a href=\"https:\/\/developer.android.com\/jetpack\/compose\/architecture#udf\" rel=\"noopener noreferrer nofollow\">\u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0437\u0434\u0435\u0441\u044c<\/a>.<\/p>\n<h2>\u0417\u043d\u0430\u043a\u043e\u043c\u0441\u0442\u0432\u043e \u0441 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439<\/h2>\n<p> Modo &#8212; \u044d\u0442\u043e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0438 \u0434\u043b\u044f Android, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0430 \u043d\u0430 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0430\u0445 UDF.\u00a0<\/p>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 \u0441\u043f\u0438\u0441\u043e\u043a \u044d\u043a\u0440\u0430\u043d\u043e\u0432 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u043a\u0430\u043a <code>List<\/code> \u0432 <code>State<\/code><\/p>\n<pre><code class=\"kotlin\">data class StackState(    val stack: List&lt;Screen> = emptyList(), )<\/code><\/pre>\n<p>\u0418 \u0435\u0441\u0442\u044c \u044d\u043a\u0448\u0435\u043d\u044b:<\/p>\n<pre><code class=\"kotlin\">class Forward(val screen: Screen, vararg val screens: Screen) : NavigationAction class Replace(val screen: Screen, vararg val screens: Screen) : NavigationAction class NewStack(val screen: Screen, vararg val screens: Screen) : NavigationAction class BackTo(val screen: Screen) : NavigationAction ...<\/code><\/pre>\n<p>\u041d\u0430 \u044d\u0442\u043e \u043c\u043e\u043c\u0435\u043d\u0442\u0435 \u043c\u043e\u0436\u043d\u043e \u0443\u0436\u0435 \u043f\u043e\u043d\u044f\u0442\u044c \u0440\u0430\u0437 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0430 \u043d\u0430 UDF, \u0442\u043e <code>Action<\/code> \u043c\u0435\u043d\u044f\u0435\u0442 <code>State<\/code>, \u0430 <code>State<\/code> \u043c\u0435\u043d\u044f\u0435\u0442 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u044d\u043a\u0440\u0430\u043d\u043e\u0432. <\/p>\n<h2>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u044e<\/h2>\n<p>\u0427\u0430\u0441\u0442\u043e \u0432 \u043c\u043d\u043e\u0433\u043e\u043c\u043e\u0434\u0443\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445 \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u0443\u044e \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u044e. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043b\u0438\u0431\u043e \u043a\u043e\u0440\u043d\u0435\u0432\u0443\u044e \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u044e, \u043b\u0438\u0431\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u044e \u0444\u0438\u0447\u0438.<\/p>\n<p>\u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u043b\u044f \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0438 \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u0440\u043e\u0434\u0443\u0431\u043b\u0438\u0440\u0443\u0435\u043c \u044d\u043a\u0448\u0435\u043d\u044b Modo<\/p>\n<pre><code class=\"kotlin\">interface NavigationAction   data class NavigationForward(val screen: Screen, val screens: List&lt;Screen> = emptyList()) :    NavigationAction   data class NavigationReplace(val screen: Screen, val screens: List&lt;Screen> = emptyList()) :    NavigationAction  ...<\/code><\/pre>\n<p>\u0417\u0430\u0442\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043c\u0430\u043f\u043f\u0435\u0440, \u0447\u0442\u043e\u0431\u044b \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0438\u0442\u044c \u043d\u0430\u0448\u0438 \u044d\u043a\u0448\u0435\u043d\u044b \u0432 \u044d\u043a\u0448\u0435\u043d\u044b Modo. <\/p>\n<pre><code class=\"kotlin\">fun NavigationContainer&lt;StackState>.navigate(command: NavigationCommand) {    val action = when (command) {        is NavigationSetStack -> SetStack(StackState(stack = command.screens))        is NavigationForward -> Forward(command.screen, *command.screens.toTypedArray())        ...<\/code><\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043a\u043b\u0430\u0441\u0441 \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0438, \u0433\u0434\u0435 \u043c\u044b \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u043d\u0430\u0448\u0438 \u044d\u043a\u0448\u0435\u043d\u044b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0435\u0442\u043e\u0434\u0430 <code>navigate(command: NavigationCommand)<\/code>  \u0438 \u0441\u043b\u0443\u0448\u0430\u0435\u043c \u043d\u0430\u0448\u0438 \u044d\u043a\u0448\u0435\u043d\u044b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>commandsFlow<\/code>. <\/p>\n<pre><code class=\"kotlin\">class Navigation {     private val _commandsFlow = Channel&lt;NavigationCommand>()      val commandsFlow: Flow&lt;NavigationCommand> = _commandsFlow.receiveAsFlow()      suspend fun navigate(command: NavigationCommand) {        _commandsFlow.send(command)    } } <\/code><\/pre>\n<p>\u041d\u0430 \u044d\u0442\u043e\u043c \u043f\u0440\u0438\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0435\u0439 \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u044e\u0442\u0441\u044f. <\/p>\n<h2>\u0421\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u044f \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0438 \u0441 \u044d\u043a\u0440\u0430\u043d\u043e\u043c<\/h2>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0447\u043d\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439 Dagger. <\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0432 \u0434\u0430\u0433\u0433\u0435\u0440-\u043c\u043e\u0434\u0443\u043b\u0435 \u043d\u0430\u0448\u0443 \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u044e. <\/p>\n<pre><code class=\"kotlin\">@Module internal class FeatureModule {     @Provides    @Singleton    @FeatureNavigationQualifier    fun provideNavigation(): Navigation = Navigation() }<\/code><\/pre>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0438 \u043f\u0440\u0438\u043a\u0440\u0435\u043f\u0438\u043c \u0435\u0433\u043e \u043a \u0434\u0430\u0433\u0433\u0435\u0440-\u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0435, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043d\u0430\u0448\u0435\u0439 \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0438.<\/p>\n<pre><code class=\"kotlin\">interface FeatureDependenciesProvider {      @FeatureNavigationQualifier    fun navigation(): Navigation }   internal interface FeatureComponent : FeatureDependenciesProvider<\/code><\/pre>\n<p>\u0417\u0430\u0442\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c <code>CompositionLocal<\/code> \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0438 \u0447\u0435\u0440\u0435\u0437 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441<\/p>\n<pre><code class=\"kotlin\">val LocalFeatureDependenciesProvider = compositionLocalOf&lt;FeatureDependenciesProvider> {    error(\"FeatureDependenciesProvider not found\") }<\/code><\/pre>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u044e \u0432 <code>ViewModel<\/code> \u0438 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0441\u043b\u0443\u0448\u0430\u0442\u0435\u043b\u044c \u044d\u043a\u0448\u0435\u043d\u043e\u0432 <code>navigationCommands<\/code>, \u0433\u0434\u0435 \u0432 UI \u044d\u0442\u0438 \u044d\u043a\u0448\u0435\u043d\u044b \u0443\u0436\u0435 \u0431\u0443\u0434\u0443\u0442 \u043c\u0430\u043f\u0438\u0442\u044c\u0441\u044f \u0432 Modo-\u044d\u043a\u0448\u0435\u043d\u044b<\/p>\n<pre><code class=\"kotlin\">internal class FeatureViewModel @Inject constructor(    @FeatureNavigationQualifier private val navigation: Navigation, ) : ViewModel() {      val navigationCommands: Flow&lt;NavigationCommand> = rootNavigation.commandsFlow } <\/code><\/pre>\n<p>\u0412 UI \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043b\u0430\u0441\u0441 <code>StackScreen<\/code> \u0438\u0437 Modo, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u0442 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u044d\u043a\u0440\u0430\u043d \u0438\u0437 stack \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0435\u0442\u043e\u0434\u0430 <code>TopScreenContent()<\/code> <\/p>\n<pre><code class=\"kotlin\">@Parcelize class FeatureStackScreen(    private val navigationModel: StackNavModel, ) : StackScreen(navigationModel = navigationModel) {      @Composable    override fun Content() {        val componentHolder = daggerViewModel {           ComponentHolder(DaggerFeatureComponent.builder().build())         }       val viewModel = daggerViewModel { componentHolder.component.viewModel() }        LaunchedEffect(Unit) {            viewModel.navigationCommands.collectLatest { command ->                navigate(command)            }        }        CompositionLocalProvider(            LocalFeatureDependenciesProvider provides componentHolder.component as FeatureDependenciesProvider        ) {      TopScreenContent()        }    } } <\/code><\/pre>\n<p>\u0433\u0434\u0435, \u044d\u0442\u043e\u0442 \u043a\u0443\u0441\u043e\u043a \u043a\u043e\u0434\u0430 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u043c\u0430\u043f\u043f\u0438\u043d\u0433 \u043d\u0430\u0448\u0435\u0433\u043e \u044d\u043a\u0448\u0435\u043d\u0430 \u0432 modo \u044d\u043a\u0448\u0435\u043d<\/p>\n<pre><code class=\"kotlin\">LaunchedEffect(Unit) {   viewModel.navigationCommands.collectLatest { command ->     navigate(command)   } }<\/code><\/pre>\n<p>\u0430 \u044d\u0442\u043e\u0442 \u043a\u0443\u0441\u043e\u043a \u043a\u043e\u0434\u0430 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e \u044d\u043a\u0440\u0430\u043d\u0430 \u0438\u0437 stack c \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0435\u0442\u043e\u0434\u0430 <code>TopScreenContent()<\/code> \u0438 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044f\u043c\u0438 \u0434\u0430\u0433\u0433\u0435\u0440-\u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b c \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>FeatureDependenciesProvider<\/code> <\/p>\n<pre><code class=\"kotlin\">CompositionLocalProvider(   LocalFeatureDependenciesProvider provides componentHolder.component as FeatureDependenciesProvider ) {     TopScreenContent()   }<\/code><\/pre>\n<p>\u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u0432\u044b\u0448\u0435\u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u0434\u043b\u044f \u0440\u0443\u0442\u043e\u0432\u043e\u0439 \u0438 \u0444\u0438\u0447\u0430 \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0438. \u041e\u0442\u043b\u0438\u0447\u0438\u0439 \u0432 \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u0438 \u0434\u043b\u044f \u0440\u0443\u0442\u043e\u0432\u043e\u0433\u043e \u0438 \u0444\u0438\u0447\u0430 \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0438 \u043d\u0435\u0442. \u0420\u0430\u0437\u0432\u0435 \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u0438\u0441\u0430\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u0435 \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u044b \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0438 \u0440\u0430\u0437\u043d\u044b\u0435 Qualifier \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0438\u0437 \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0438. <\/p>\n<h2>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0432 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0438<\/h2>\n<p>\u041d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043a\u043e\u0434\u0430  \u0434\u043b\u044f \u0440\u0430\u0437\u043d\u044b\u0445 \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0439 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u043e\u0442\u043b\u0438\u0447\u0438\u0439. \u0414\u0430\u0436\u0435 root \u0438 feature \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0438 \u0431\u0443\u0434\u0443\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e. \u042d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0432\u0441\u0435\u0433\u0434\u0430 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a. <\/p>\n<pre><code class=\"kotlin\">internal class FeatureViewModel @Inject constructor(    @FeatureNavigationQualifier private val navigation: Navigation,    private val screens: Screens, ) : ViewModel() {     init {      viewModelScope.launch {             rootNavigation.navigate(NavigationReplace(screens.someScreen()))         }    }    val navigationCommands: Flow&lt;NavigationCommand> = navigation.commandsFlow    fun onSomeActionHappened() {     navigation.navigate(NavigationReplace(screens.someScreen()))   } } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043c \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0434\u0432\u0443\u0445 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u0444\u0438\u0447\u0435\u0439 <code>Complex<\/code> \u0438 <code>Simple<\/code>, \u0433\u0434\u0435 \u0444\u0438\u0447\u0430 <code>Complex<\/code> \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0432\u043d\u0443\u0442\u0440\u0438 \u0441\u0435\u0431\u044f sub-feature. \u0410 \u0424\u0438\u0447\u0430 <code>Simple<\/code> \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0438\u0437 \u0441\u0435\u0431\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u044d\u043a\u0440\u0430\u043d. <\/p>\n<p>\u0413\u0434\u0435 \u0431\u0443\u0434\u0443\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0438:<\/p>\n<ol>\n<li>\n<p>Root Navigation &#8212; \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u044f \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u0444\u0438\u0447\u0435\u0439 <\/p>\n<\/li>\n<li>\n<p>Feature Navigation &#8212; \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u044f \u0444\u0438\u0447\u0435\u0439 Complex<\/p>\n<\/li>\n<\/ol>\n<figure class=\"full-width\"><\/figure>\n<p>\u0415\u0441\u043b\u0438 \u0432 \u0442\u0430\u043a\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u043d\u0443\u0436\u043d\u043e \u0438\u0437 \u0444\u0438\u0447\u0438 <code>Complex<\/code> \u043e\u0442\u043a\u0440\u044b\u0442\u044c \u0444\u0438\u0447\u0443 <code>Simple<\/code>, \u0442\u043e \u0432 \u043d\u0430\u0448\u0435\u043c <code>ViewModel<\/code> \u0431\u0443\u0434\u0435\u0442 \u0434\u0432\u0430 \u043a\u043b\u0430\u0441\u0441\u0430 \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0438:<\/p>\n<ul>\n<li>\n<p> Root Navigation &#8212; \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043d\u0430 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0432\u044b\u0448\u0435 \u043d\u0430\u0448\u0435\u0433\u043e \u044d\u043a\u0440\u0430\u043d\u0430.<\/p>\n<\/li>\n<li>\n<p>Feature Navigation &#8212; \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u044f \u0444\u0438\u0447\u0438 <code>Complex<\/code><\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f, \u043a\u043e\u0433\u0434\u0430 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u0441\u044f \u044d\u043a\u0448\u0435\u043d \u043e\u0442\u043a\u0440\u044b\u0442\u0438\u044f \u0444\u0438\u0447\u0438 <code>Simple<\/code>, \u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0440\u0443\u0442\u043e\u0432\u0430\u044f \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u044f, \u0430 \u043d\u0435 \u0444\u0438\u0447\u043e\u0432\u0430\u044f \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u044f. <\/p>\n<pre><code class=\"kotlin\">internal class ComplexViewModel @Inject constructor(    @RootNavigationQualifier private val rootNavigation: Navigation,    @FeatureNavigationQualifier private val complex: Navigation,    private val rootScreens: RootScreens, ) : ViewModel() {    val navigationCommands: Flow&lt;NavigationCommand> = featureNavigation.commandsFlow    fun onSomeActionHappened() {     rootNavigation.navigate(NavigationReplace(rootScreens.simpleScreen()))   } }<\/code><\/pre>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<figure class=\"float full-width\"><\/figure>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438 \u043e\u0434\u0438\u043d \u0438\u0437 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 Modo \u0432 \u043c\u043d\u043e\u0433\u043e\u043c\u043e\u0434\u0443\u043b\u044c\u043d\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435. \u041c\u043e\u0436\u043d\u043e \u0434\u0430\u043b\u044c\u0448\u0435 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u0443\u044e \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u044e \u0441\u043d\u0438\u0436\u0430\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c \u043e\u0442 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0438\u043b\u0438 \u043c\u043e\u0436\u043d\u043e \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0430\u044f \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0441 Modo, \u043d\u0435 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u044f \u0441\u0432\u043e\u0438 \u043a\u043b\u0430\u0441\u0441\u044b. <a href=\"https:\/\/github.com\/dns21395\/ModoMultimodule\" rel=\"noopener noreferrer nofollow\">\u0422\u0430\u043a\u0436\u0435 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u043c \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u043d\u044b\u043c \u0432 \u0441\u0442\u0430\u0442\u044c\u0435<\/a>.<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/799033\/\"> https:\/\/habr.com\/ru\/articles\/799033\/<\/a><br \/><\/br><\/br><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-370340","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/370340","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=370340"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/370340\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=370340"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=370340"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=370340"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}