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

Commit

Permalink
feat: Lazy Componentes childrenAsList (#40)
Browse files Browse the repository at this point in the history
* Fixes modal

Signed-off-by: Hernand Azevedo <[email protected]>

* Removing shared flow

Signed-off-by: Hernand Azevedo <[email protected]>

* Removing shared flow

Signed-off-by: Hernand Azevedo <[email protected]>

* upgrading navigation-compose version to fix popToView crash

Signed-off-by: Hernand Azevedo <[email protected]>

* upgrading navigation-compose version to fix popToView crash

Signed-off-by: Hernand Azevedo <[email protected]>

* upgrades gradle wrapper

Signed-off-by: Hernand Azevedo <[email protected]>

* Disable jacoco and sonar since its crashing with gradle 7.5.x until fixing

Signed-off-by: Hernand Azevedo <[email protected]>

* Simplify navigation

Signed-off-by: Hernand Azevedo <[email protected]>

* Fixes popTo first screen url

Signed-off-by: Hernand Azevedo <[email protected]>

* Fixes modal

Signed-off-by: Hernand Azevedo <[email protected]>

* Fixes modal

Signed-off-by: Hernand Azevedo <[email protected]>

* Fixes modal

Signed-off-by: Hernand Azevedo <[email protected]>

* Simplify modal

Signed-off-by: Hernand Azevedo <[email protected]>

* Simplify modal 2

Signed-off-by: Hernand Azevedo <[email protected]>

* Simplify modal 3

Signed-off-by: Hernand Azevedo <[email protected]>

* Extract modal state

Signed-off-by: Hernand Azevedo <[email protected]>

* Extract modal state

Signed-off-by: Hernand Azevedo <[email protected]>

* Rafactor json name

Signed-off-by: Hernand Azevedo <[email protected]>

* Mitigation of recomposition

Signed-off-by: Hernand Azevedo <[email protected]>

* Refactor internal

Signed-off-by: Hernand Azevedo <[email protected]>

* Lazy components childrenAsList

Signed-off-by: Hernand Azevedo <[email protected]>

* Renaming file

Signed-off-by: Hernand Azevedo <[email protected]>

Signed-off-by: Hernand Azevedo <[email protected]>
  • Loading branch information
hernandazevedozup authored Nov 11, 2022
1 parent 200ad7f commit 5eac3db
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ import com.zup.nimbus.core.tree.ServerDrivenNode
class ComponentData(
val node: ServerDrivenNode,
val children: @Composable () -> Unit,
val childrenAsList: List<@Composable () -> Unit>,
)
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,20 @@ fun RenderedNode(flow: NodeFlow) {
children?.forEach {
key(it.id) { RenderedNode(it) }
}
}
},
childrenAsList = childrenList(children)
)
)
}

fun childrenList(children: List<NodeFlow>?): List<@Composable () -> Unit> {
val mutableList = mutableListOf<@Composable () -> Unit>()

children?.forEach {
mutableList.add {
key(it.id) { RenderedNode(it) }
}
}

return mutableList
}

0 comments on commit 5eac3db

Please sign in to comment.