i tryed using a delay but i dont think delay works...
# compose-web
d
i tryed using a delay but i dont think delay works is kotlin js?
r
delay
works fine in kotlin/js -- just make sure you are in a suspending function
d
So you are right delay works but my code fails here when i use a delay with out erroring
Copy code
uiState = uiState.copy(traits = uiState.traits.toMutableList().apply {
                add(bar.next())
                add(foo.next())

            })
                delay(1000)

                uiState = uiState.copy(traits = uiState.traits.toMutableList().apply {
                    add(bar.next())
                    add(foo.next())

                })
if the delay is not there the code works as i expect if its its there the list will start to full then be empty
a flow may do a better job of what i want but i still would love to know whats going on here