🐣
This commit is contained in:
commit
22ae65c92f
8 changed files with 188 additions and 0 deletions
33
src/Skog.gren
Normal file
33
src/Skog.gren
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
module Skog exposing (Program, program)
|
||||
|
||||
{-| Define a multi-platform Skog program.
|
||||
|
||||
The app provides shared `init`, `update`, and `subscriptions` along with
|
||||
separate `mobileView` and `desktopView` functions. Bridges (SwiftUI,
|
||||
Compose, DOM) consume the views; this stub just wires up a Platform.worker.
|
||||
-}
|
||||
|
||||
import Desktop exposing (Desktop)
|
||||
import Mobile exposing (Mobile)
|
||||
import Platform
|
||||
import UI
|
||||
|
||||
|
||||
type alias Program model msg =
|
||||
Platform.Program {} model msg
|
||||
|
||||
|
||||
program :
|
||||
{ init : { model : model, command : Cmd msg }
|
||||
, update : msg -> model -> { model : model, command : Cmd msg }
|
||||
, subscriptions : model -> Sub msg
|
||||
, mobileView : model -> UI.Element Mobile msg
|
||||
, desktopView : model -> UI.Element Desktop msg
|
||||
}
|
||||
-> Program model msg
|
||||
program config =
|
||||
Platform.worker
|
||||
{ init = \_ -> config.init
|
||||
, update = config.update
|
||||
, subscriptions = config.subscriptions
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue