diff options
Diffstat (limited to 'frontend/app/Page.hs')
-rw-r--r-- | frontend/app/Page.hs | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/frontend/app/Page.hs b/frontend/app/Page.hs index 16191dd..7c200c8 100644 --- a/frontend/app/Page.hs +++ b/frontend/app/Page.hs @@ -16,6 +16,7 @@ import Page.ListCollection qualified as ListCollection import Page.NewCollection qualified as NewCollection import Route (Route) import Route qualified as Route +import Effect (Eff) data Page = Home @@ -42,19 +43,19 @@ initialPage (Route.EditValue c f) = initialPage Route.NewCollection = fmap NewCollection <$> NewCollection.initialModel -updatePage :: Action -> Page -> Effect Action Page +updatePage :: Action -> Page -> (Effect Action Page, [Eff]) updatePage (HandleListCollection action) (ListCollection m) = ListCollection.updateModel action m - & bimap HandleListCollection ListCollection -updatePage (HandleListCollection _) p = noEff p + & first (bimap HandleListCollection ListCollection) +updatePage (HandleListCollection _) p = (noEff p, []) updatePage (HandleEditValue action) (EditValue m) = EditValue.updateModel action m - & bimap HandleEditValue EditValue -updatePage (HandleEditValue _) p = noEff p + & first (bimap HandleEditValue EditValue) +updatePage (HandleEditValue _) p = (noEff p, []) updatePage (HandleNewCollection action) (NewCollection m) = NewCollection.updateModel action m - & bimap HandleNewCollection NewCollection -updatePage (HandleNewCollection _) p = noEff p + & first (bimap HandleNewCollection NewCollection) +updatePage (HandleNewCollection _) p = (noEff p, []) viewPage :: Page -> View Action viewPage Home = text "home" |