reload collections when creating
This commit is contained in:
@@ -15,6 +15,7 @@ import Data.Maybe
|
||||
import Form qualified as F
|
||||
import Miso
|
||||
import Miso.String (toMisoString)
|
||||
import Effect (Eff)
|
||||
import Schema
|
||||
|
||||
data Model = Model
|
||||
@@ -41,12 +42,12 @@ data Action
|
||||
| EntityWritten (Either String ())
|
||||
deriving (Eq, Show)
|
||||
|
||||
updateModel :: Action -> Model -> Effect Action Model
|
||||
updateModel NoOp m = noEff m
|
||||
updateModel (FormChanged (Just -> input)) m = noEff m {input}
|
||||
updateModel :: Action -> Model -> (Effect Action Model, [Eff])
|
||||
updateModel NoOp m = (noEff m, [])
|
||||
updateModel (FormChanged (Just -> input)) m = (noEff m {input}, [])
|
||||
updateModel (FormSubmitted output) m =
|
||||
m <# do EntityWritten <$> updatePost m.fileName output
|
||||
updateModel (EntityWritten _) m = noEff m
|
||||
(m <# do EntityWritten <$> updatePost m.fileName output, [])
|
||||
updateModel (EntityWritten _) m = (noEff m, [])
|
||||
|
||||
viewModel :: Model -> View Action
|
||||
viewModel m = do
|
||||
|
||||
Reference in New Issue
Block a user