Skip to content

Instantly share code, notes, and snippets.

@evancz evancz/User.elm Secret
Last active Mar 30, 2016

What would you like to do?
-- when someone wants to use our widget
-- they don't need to know any facts about anything!
import Update (step)
import Model (initialize)
import View (view)
-- nothing gives access to any details, and things
-- will work as they need to. One trick here is to
-- make sure the view function takes a (Handle Action)
-- as an argument such that it can be wired up later.
module Model (initialize) where
import UnderlyingModel (..)
initialize : Int -> ... -> State
noop : Action
module UnderlyingModel where
type State = { count:Int, ... }
data Action = ...
module Update (step) where
import UnderlyingModel (..)
step : Action -> State -> State
module View (view) where
import UnderlyingModel (..)
view : Handle Action -> State -> Element
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.