You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed that Elm/Random has no way to generate a random value as a Task. I’m not sure if this is intended.
Currently, I am trying to build a chat with Jsonstore at the backend.
If I now want to create a new chatroom, I need to first generate a number and then create the room.
sadly, Random has now task version of gernerate and therefore i need to instead split up the task into two messages.
update : Msg -> Model -> (Model,Cmd Msg)
update msg model =
case msg of
PressedNewRoomButton ->
( model
, Random.generate Random.int 0 Random.maxInt
)
GeneratedRoomId int ->
( model
, insertNewRoom int
|> Task.attempt Sync
)
The text was updated successfully, but these errors were encountered:
I noticed that Elm/Random has no way to generate a random value as a Task. I’m not sure if this is intended.
Currently, I am trying to build a chat with Jsonstore at the backend.
If I now want to create a new chatroom, I need to first generate a number and then create the room.
sadly, Random has now task version of gernerate and therefore i need to instead split up the task into two messages.
The text was updated successfully, but these errors were encountered: