Commit 70425023 authored by Mael NICOLAS's avatar Mael NICOLAS

rewrite the let and rename `id`

parent 46038d62
...@@ -26,12 +26,11 @@ performAction :: forall eff props. PerformAction ( console :: CONSOLE ...@@ -26,12 +26,11 @@ performAction :: forall eff props. PerformAction ( console :: CONSOLE
| eff ) State props Action | eff ) State props Action
performAction NoOp _ _ = void do performAction NoOp _ _ = void do
modifyState id modifyState id
performAction (FetchUser id) _ _ = void do performAction (FetchUser userId) _ _ = void do
value <- lift $ getUser id value <- lift $ getUser userId
let user = case value of _ <- case value of
(Right user) -> Just user (Right user) -> modifyState \state -> set _user (Just user) state
_ -> Nothing _ -> modifyState id
_ <- pure <<< log $ "Fetching user..." pure <<< log $ "Fetching user..."
pure $ modifyState \state -> set _user user state
performAction _ _ _ = void do performAction _ _ _ = void do
modifyState id modifyState id
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment