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.*
66private val scope = MainScope ()
77
88val app = fc<Props > {
9- val ( shoppingList, setShoppingList) = useState(emptyList<ShoppingListItem >())
9+ var shoppingList by useState(emptyList<ShoppingListItem >())
1010
1111 useEffectOnce {
1212 scope.launch {
13- setShoppingList( getShoppingList() )
13+ shoppingList = getShoppingList()
1414 }
1515 }
1616
@@ -24,7 +24,7 @@ val app = fc<Props> {
2424 attrs.onClickFunction = {
2525 scope.launch {
2626 deleteShoppingListItem(item)
27- setShoppingList( getShoppingList() )
27+ shoppingList = getShoppingList()
2828 }
2929 }
3030 + " [${item.priority} ] ${item.desc} "
@@ -36,7 +36,7 @@ val app = fc<Props> {
3636 val cartItem = ShoppingListItem (input.replace(" !" , " " ), input.count { it == ' !' })
3737 scope.launch {
3838 addShoppingListItem(cartItem)
39- setShoppingList( getShoppingList() )
39+ shoppingList = getShoppingList()
4040 }
4141 }
4242 }
You can’t perform that action at this time.
0 commit comments