reload collections when creating
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user