Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Potential API tweak
module Application exposing (..., init, update, bundle, Initializer, Updater, Bundler)
type Initializer =
Initializer (Context -> ( Model, Cmd Msg, Cmd App.Msg))
type Updater =
Updater (Context -> ( Model, Cmd Msg, Cmd App.Msg))
type Bundler =
Bundler (Context -> Bundle Msg)
init : { page : Page } -> Initializer
update : { page : Page, model : Model, msg : Msg } -> Updater
view : { page : Page, model : Model } -> Bundler
module Pages exposing (init, update, bundle)
init : Route -> Initializer
update : Msg -> Model -> Updater
view : Model -> Context -> Bundler
-- CURRENT API --
module Application exposing (..., init, update, bundle)
init : { page : Page } -> Context -> ( Model, Cmd Msg, Cmd App.Msg)
update : { page : Page, model : Model, msg : Msg } -> Context -> ( Model, Cmd Msg, Cmd App.Msg)
view : { page : Page, model : Model } -> Context -> Bundle Msg
module Pages exposing (init, update, bundle)
init : Route -> Context -> ( Model, Cmd Msg, Cmd App.Msg)
update : Msg -> Model -> Context -> ( Model, Cmd Msg, Cmd App.Msg)
view : Model -> Context -> Bundle Msg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment