File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -6,11 +6,11 @@ import kotlinx.coroutines.*
6
6
private val scope = MainScope ()
7
7
8
8
val app = fc<Props > {
9
- val ( shoppingList, setShoppingList) = useState(emptyList<ShoppingListItem >())
9
+ var shoppingList by useState(emptyList<ShoppingListItem >())
10
10
11
11
useEffectOnce {
12
12
scope.launch {
13
- setShoppingList( getShoppingList() )
13
+ shoppingList = getShoppingList()
14
14
}
15
15
}
16
16
@@ -24,7 +24,7 @@ val app = fc<Props> {
24
24
attrs.onClickFunction = {
25
25
scope.launch {
26
26
deleteShoppingListItem(item)
27
- setShoppingList( getShoppingList() )
27
+ shoppingList = getShoppingList()
28
28
}
29
29
}
30
30
+ " [${item.priority} ] ${item.desc} "
@@ -36,7 +36,7 @@ val app = fc<Props> {
36
36
val cartItem = ShoppingListItem (input.replace(" !" , " " ), input.count { it == ' !' })
37
37
scope.launch {
38
38
addShoppingListItem(cartItem)
39
- setShoppingList( getShoppingList() )
39
+ shoppingList = getShoppingList()
40
40
}
41
41
}
42
42
}
You can’t perform that action at this time.
0 commit comments