Skip to content

Commit

Permalink
use lazy functions initializing home and wishlist
Browse files Browse the repository at this point in the history
  • Loading branch information
Larocceau committed Mar 8, 2024
1 parent 14ccb07 commit 308f216
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Client/pages/Home.fs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ let bookRow book =

[<ReactComponent>]
let View api =
let model, dispatch = React.useElmish (init api, update, [||])
let model, dispatch = React.useElmish ((fun () -> init api), update, [||])

Html.div [
prop.className "overflow-y-auto"
Expand Down
2 changes: 1 addition & 1 deletion src/Client/pages/WishList.fs
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ let table model dispatch =
let View user =
let api: IWishListApi = wishListApi user.Token

let model, dispatch = React.useElmish (init api user, update api, [||])
let model, dispatch = React.useElmish ((fun () -> init api user), update api, [||])
let user = model.Wishlist.UserName.Value
let lastReset = model.LastResetTime.ToString("yyyy-MM-dd HH:mm")

Expand Down

0 comments on commit 308f216

Please sign in to comment.