diff options
Diffstat (limited to 'frontend/app/Page/ListCollection.hs')
-rw-r--r-- | frontend/app/Page/ListCollection.hs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/frontend/app/Page/ListCollection.hs b/frontend/app/Page/ListCollection.hs index 93ea389..9acca3c 100644 --- a/frontend/app/Page/ListCollection.hs +++ b/frontend/app/Page/ListCollection.hs @@ -10,9 +10,9 @@ where import Api import Data.Aeson qualified as A import Data.Aeson.KeyMap qualified as AM +import Effect (Eff) import Miso import Schema -import Effect (Eff) data Model = Model { collection :: String, @@ -31,12 +31,10 @@ initialModel collection = do posts <- posts' pure $ Model {input = A.Object AM.empty, ..} -data Action - = NoOp - deriving (Eq, Show) +newtype Action = Action (Model -> (Effect Action Model, [Eff])) updateModel :: Action -> Model -> (Effect Action Model, [Eff]) -updateModel NoOp m = (noEff m, []) +updateModel (Action f) m = f m viewModel :: Model -> View Action viewModel m = |