Skip to content
This repository has been archived by the owner on Aug 5, 2024. It is now read-only.

Commit

Permalink
self review
Browse files Browse the repository at this point in the history
  • Loading branch information
Tiagoperes committed Dec 13, 2022
1 parent edef2bd commit 2ac3f7f
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@
package br.com.zup.nimbus.compose.internal

import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.navigation.NavBackStackEntry
import androidx.navigation.NavHostController
import br.com.zup.nimbus.compose.ErrorHandler
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,15 @@

package br.com.zup.nimbus.compose.internal

import android.util.Log
import androidx.compose.runtime.Composable
import androidx.compose.runtime.State
import androidx.compose.runtime.collectAsState
import br.com.zup.nimbus.compose.CoroutineDispatcherLib
import br.com.zup.nimbus.core.dependency.Dependent
import br.com.zup.nimbus.core.tree.ServerDrivenNode
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.ExecutorCoroutineDispatcher
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.launch
import kotlinx.coroutines.newSingleThreadContext

class NodeState(
private val node: ServerDrivenNode,
Expand All @@ -37,11 +34,9 @@ class NodeState(
operator fun component2() = children
}

class NodeFlow(
private val node: ServerDrivenNode,
private val scope: CoroutineScope = CoroutineScope(CoroutineDispatcherLib.backgroundPool)
): Dependent {
class NodeFlow(private val node: ServerDrivenNode): Dependent {
private var memoizedChildren: MutableMap<String, NodeFlow> = mutableMapOf()
private val scope = CoroutineScope(CoroutineDispatcherLib.backgroundPool)
private val current = MutableStateFlow(NodeState(node, calculateChildren()))
val id: String get() = node.id

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

package br.com.zup.nimbus.compose.model

import android.util.Log
import androidx.compose.runtime.Composable
import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue
Expand Down

0 comments on commit 2ac3f7f

Please sign in to comment.