SlideShare a Scribd company logo
Torschlusspanik
Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 1
TorschlusspanikThe fear of time running out.
Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 2
Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 3
Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 4
Iaccidentallykinda didthis
It wasn't the plan!
Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 5
What'sthisallaboutthen?
» Intro to Phoenix and Elm
» Intro to Firestorm, and its architecture
» Discussion of how Elm interacts with Phoenix
» Remaining interesting ideas and conclusion
Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 6
Phoenix
Productive.Reliable.Fast.
Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 7
Reasons to care
aboutPhoenix» Ecto is nice
» Phoenix 1.3 made things better
» Channels are amazing
Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 8
Phoenix code examples
» Schema
» Controller
» View (for json api)
» Router
» Plug (just comment on how nice the abstraction is)
Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 9
defmodule FirestormData.Category do
use Ecto.Schema
alias FirestormData.{Repo, Thread, View, Follow, Tagging, Tag}
# ...
schema "categories" do
field :title, :string
field :slug, TitleSlug.Type
field :children, :any, virtual: true
field :ancestors, :any, virtual: true
belongs_to :parent, __MODULE__
has_many :threads, Thread
has_many :views, {"categories_views", View}, foreign_key: :assoc_id
has_many :follows, {"categories_follows", Follow}, foreign_key: :assoc_id
has_many :taggings, {"categories_taggings", Tagging}, foreign_key: :assoc_id
many_to_many :tags, Tag, join_through: "categories_taggings", join_keys: [assoc_id: :id, tag_id: :id]
timestamps()
end
# ...
end
Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 10
defmodule FirestormWeb.Web.CategoryController do
use FirestormWeb.Web, :controller
alias FirestormData.Commands.{GetCategory, CreateCategory, TagCategory}
plug FirestormWeb.Plugs.RequireUser when action in [:tag, :new, :create]
def show(conn, %{"id" => id_or_slug}) do
finder = get_finder(id_or_slug)
tag_category_changeset =
%TagCategory{}
|> TagCategory.changeset(%{})
case GetCategory.run(%GetCategory{finder: finder}) do
{:ok, c} ->
conn
|> render("show.html", category: c, tag_category_changeset: tag_category_changeset)
{:error, :not_found} ->
conn
|> put_flash(:error, "No such category!")
|> redirect(to: page_path(conn, :home))
end
end
Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 11
defmodule FirestormWeb.Web.Api.V1.FetchView do
use FirestormWeb.Web, :view
alias FirestormData.Category
import Ecto.Query
alias FirestormWeb.Web.Api.V1.HomeView
def render("index.json", %{categories: categories, users: users, threads: threads, posts: posts}) do
%{
categories: Enum.map(categories, &HomeView.category_json/1),
threads: Enum.map(threads, &HomeView.thread_json/1),
posts: Enum.map(posts, &HomeView.post_json/1),
users: Enum.map(users, &HomeView.user_json/1)
}
end
end
Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 12
defmodule FirestormWeb.Web.Router do
use FirestormWeb.Web, :router
pipeline :browser do
plug :accepts, ["html"]
plug :fetch_session # , fetch_flash, protect_from_forgery, put_secure_browser_headers
plug FirestormWeb.Plugs.CurrentUser
end
scope "/", FirestormWeb.Web do
pipe_through :browser # Use the default browser stack
get "/", PageController, :index
get "/home", PageController, :home
post "/categories/:id/tag", CategoryController, :tag
resources "/categories", CategoryController do
post "/threads/:id/tag", ThreadController, :tag
get "/threads/:id/follow", ThreadController, :follow
get "/threads/:id/unfollow", ThreadController, :unfollow
resources "/threads", ThreadController do
resources "/posts", PostController
end
end
end
Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 13
PlugElm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 14
A delightful language
for reliablewebapps.
ElmElm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 15
Functional!Strongly Typed!
No runtime errors!
The Elm Architecture!
Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 16
Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 17
Basic Elmapp(everyone needs a counter, right?)
Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 18
type alias Model =
Int
type CounterMsg
= Increment
| Decrement
Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 19
update : CounterMsg -> Model -> Model
update msg model =
case msg of
Decrement ->
model - 1
Increment ->
model + 1
Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 20
view : Model -> Html CounterMsg
view model =
div []
[ button [ onClick Decrement ] [ text "-" ]
, div [] [ text (toString model) ]
, button [ onClick Increment ] [ text "+" ]
]
Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 21
BriefMarketingAside
Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 22
Beabetter
developer
Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 23
www.dailydrip.com
Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 24
DailyContinuing
Education for
Developers
Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 25
www.dailydrip.com
Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 26
/ BriefMarketing Aside
Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 27
An open-source Phoenix-based
Forumwithan Elm frontend
Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 28
» http://github.com/dailydrip/firestorm
» http://firestorm-dogfood.herokuapp.com
Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 29
DesignWalkthrough
Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 30
Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 31
Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 32
Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 33
Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 34
Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 35
Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 36
Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 37
Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 38
Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 39
Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 40
/ DesignWalkthrough
Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 41
Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 42
DATAElm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 43
WEBElm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 44
NOTIFIER
Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 45
The neat API
or stupid?» JSON-API meets GraphQL...
» ...then abandons reason
Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 46
The neat API
or stupid?» JSON-API meets GraphQL...
» ...then abandons reason
Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 46
The neat API
or stupid?» JSON-API meets GraphQL...
» ...then abandons reason
Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 46
firestorm_elm
An Elm client for Firestorm
Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 47
view : Store.Model -> User.Model -> Thread.Model -> Html msg
view store user thread =
div
[ class "layout-content" ]
[ div [ class "thread-header" ]
[ h2 [] [ text thread.title ]
, div
[ class "item-metadata" ]
[ a [ href "#", class "username" ]
[ text <| "@" ++ user.username ]
]
]
, ol
[ class "post-list" ]
(List.map (postListItem store) (postsFor store.posts thread))
]
Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 48
view : Store.Model -> User.Model -> Thread.Model -> Html msg
view store user thread =
layoutContent
[ threadHeader thread user
, postList store (postsFor store.posts thread)
]
Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 49
layoutContent : List (Html msg) -> Html msg
layoutContent =
div
[ class "layout-content" ]
Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 50
postList : Store.Model -> List Post.Model -> Html msg
postList store posts =
posts
|> List.map (postListItem store)
|> ol [ class "post-list" ]
Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 51
threadHeader : Thread.Model -> User.Model -> Html msg
threadHeader thread user =
div [ class "thread-header" ]
[ h2 [] [ text thread.title ]
, div
[ class "item-metadata" ]
[ a [ href "#", class "username" ]
[ text <| "@" ++ user.username ]
]
]
Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 52
module View.Threads.Show exposing (view)
-- ...
import Components exposing (threadHeader, postList, layoutContent)
view : Store.Model -> User.Model -> Thread.Model -> Html msg
view store user thread =
layoutContent
[ threadHeader thread user
, postList store (postsFor store.posts thread)
]
postsFor : Dict Int Post.Model -> Thread.Model -> List Post.Model
postsFor posts thread =
posts
|> Dict.filter (k v -> List.member k thread.postIds)
|> Dict.toList
|> List.map (( k, v ) -> v)
Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 53
-- ...
import Components exposing (threadHeader, postList, layoutContent)
view : Store.Model -> User.Model -> Thread.Model -> Html msg
view store user thread =
layoutContent
[ threadHeader thread user
, store
|> Store.postsForThread thread
|> postList store
]
Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 54
Local
Database
SliverElm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 55
module Types.Store exposing ( Model)
type alias Model =
{ categories : Dict Int Category.Model
, threads : Dict Int Thread.Model
, users : Dict Int User.Model
, posts : Dict Int Post.Model
, wants : ReplenishRequest
}
Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 56
type alias ReplenishRequest =
{ categories : List Int
, threads : List Int
, posts : List Int
, users : List Int
}
type alias StoreUpdate =
{ categories : Dict Int Category.Model
, threads : Dict Int Thread.Model
, users : Dict Int User.Model
, posts : Dict Int Post.Model
}
Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 57
APIInteractionElm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 58
index :
String
-> (StoreUpdate -> msg)
-> (Http.Error -> msg)
-> Cmd msg
index apiBaseUrl tagger errorTagger =
"home"
|> get apiBaseUrl
|> withExpect (Http.expectJson storeUpdateDecoder)
|> send (handleGetHomeComplete tagger errorTagger)
Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 59
Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 60
Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 61
Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 62
Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 63
Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 64
Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 65
post :
ReplenishRequest
-> String
-> (StoreUpdate -> msg)
-> (Http.Error -> msg)
-> Cmd msg
post replenishRequest apiBaseUrl tagger errorTagger =
"fetch"
|> AH.post apiBaseUrl
|> withJsonBody (encodeReplenishRequest replenishRequest)
|> withExpect (Http.expectJson storeUpdateDecoder)
|> send (handleGetComplete tagger errorTagger)
Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 66
It's
FastElm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 67
DemoElm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 68
Downsides
Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 69
Solutions, kindaBut really we want realtime and the HTTP API will
never get us, so we move to Channels.
Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 70
Channels
Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 71
Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 72
Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 73
Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 74
Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 75
Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 76
Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 77
Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 78
Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 79
Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 80
Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 81
GARBAGE
COLLECTION
ON THE CLIENTElm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 82
WhynotGraphQL?“I dream of one day building a company that gets sued
by or sues Facebook.”
Dream big
Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 83
Elm is so
simpleitguidesyouto solutions
@opsb
Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 84
Althoughalanguage
can neverteach aprogrammer
whatconstitutesawell-designed program,
Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 85
it can guide him
intothinkingaboutthe rightthings.
From the paper
AbstractDataTypes
by Barbara Liskov and
Stephen Zilles
Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 86
Use Elmwith Phoenix
Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 87
It'sa great guide
Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 88
Fin.Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 89
This slide intentionallyleftblank.
Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 90
Geezus stopadvancingthis presentation.
Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 91
AMøøse once bitmysister
Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 92
Dangitthe nextslide is literally
justmyvim modelinethere's nothing
moreto see I swear.
Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 93
Dangyouto heck.
vim:tw=1000
Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 94

More Related Content

Recently uploaded

OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
Paco van Beckhoven
 
Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"
Donna Lenk
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
Drona Infotech
 
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdfVitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
rickgrimesss22
 
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissancesAtelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Neo4j
 
Empowering Growth with Best Software Development Company in Noida - Deuglo
Empowering Growth with Best Software  Development Company in Noida - DeugloEmpowering Growth with Best Software  Development Company in Noida - Deuglo
Empowering Growth with Best Software Development Company in Noida - Deuglo
Deuglo Infosystem Pvt Ltd
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Crescat
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOMLORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
lorraineandreiamcidl
 
AI Genie Review: World’s First Open AI WordPress Website Creator
AI Genie Review: World’s First Open AI WordPress Website CreatorAI Genie Review: World’s First Open AI WordPress Website Creator
AI Genie Review: World’s First Open AI WordPress Website Creator
Google
 
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppAI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
Google
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
Aftab Hussain
 
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket ManagementUtilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
Rakesh Kumar R
 
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
Alina Yurenko
 
Using Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional SafetyUsing Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional Safety
Ayan Halder
 
Artificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension FunctionsArtificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension Functions
Octavian Nadolu
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Łukasz Chruściel
 

Recently uploaded (20)

OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
 
Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
 
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdfVitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdf
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
 
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissancesAtelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissances
 
Empowering Growth with Best Software Development Company in Noida - Deuglo
Empowering Growth with Best Software  Development Company in Noida - DeugloEmpowering Growth with Best Software  Development Company in Noida - Deuglo
Empowering Growth with Best Software Development Company in Noida - Deuglo
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOMLORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
 
AI Genie Review: World’s First Open AI WordPress Website Creator
AI Genie Review: World’s First Open AI WordPress Website CreatorAI Genie Review: World’s First Open AI WordPress Website Creator
AI Genie Review: World’s First Open AI WordPress Website Creator
 
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppAI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
 
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket ManagementUtilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
 
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
 
Using Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional SafetyUsing Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional Safety
 
Artificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension FunctionsArtificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension Functions
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
 

Featured

Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
SpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
Christy Abraham Joy
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
Vit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
MindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
GetSmarter
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
Project for Public Spaces & National Center for Biking and Walking
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
DevGAMM Conference
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
Erica Santiago
 
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Saba Software
 

Featured (20)

Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
 
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
 

Elm and Phoenix: Two great flavors that taste great together

  • 1. Torschlusspanik Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 1
  • 2. TorschlusspanikThe fear of time running out. Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 2
  • 3. Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 3
  • 4. Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 4
  • 5. Iaccidentallykinda didthis It wasn't the plan! Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 5
  • 6. What'sthisallaboutthen? » Intro to Phoenix and Elm » Intro to Firestorm, and its architecture » Discussion of how Elm interacts with Phoenix » Remaining interesting ideas and conclusion Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 6
  • 7. Phoenix Productive.Reliable.Fast. Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 7
  • 8. Reasons to care aboutPhoenix» Ecto is nice » Phoenix 1.3 made things better » Channels are amazing Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 8
  • 9. Phoenix code examples » Schema » Controller » View (for json api) » Router » Plug (just comment on how nice the abstraction is) Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 9
  • 10. defmodule FirestormData.Category do use Ecto.Schema alias FirestormData.{Repo, Thread, View, Follow, Tagging, Tag} # ... schema "categories" do field :title, :string field :slug, TitleSlug.Type field :children, :any, virtual: true field :ancestors, :any, virtual: true belongs_to :parent, __MODULE__ has_many :threads, Thread has_many :views, {"categories_views", View}, foreign_key: :assoc_id has_many :follows, {"categories_follows", Follow}, foreign_key: :assoc_id has_many :taggings, {"categories_taggings", Tagging}, foreign_key: :assoc_id many_to_many :tags, Tag, join_through: "categories_taggings", join_keys: [assoc_id: :id, tag_id: :id] timestamps() end # ... end Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 10
  • 11. defmodule FirestormWeb.Web.CategoryController do use FirestormWeb.Web, :controller alias FirestormData.Commands.{GetCategory, CreateCategory, TagCategory} plug FirestormWeb.Plugs.RequireUser when action in [:tag, :new, :create] def show(conn, %{"id" => id_or_slug}) do finder = get_finder(id_or_slug) tag_category_changeset = %TagCategory{} |> TagCategory.changeset(%{}) case GetCategory.run(%GetCategory{finder: finder}) do {:ok, c} -> conn |> render("show.html", category: c, tag_category_changeset: tag_category_changeset) {:error, :not_found} -> conn |> put_flash(:error, "No such category!") |> redirect(to: page_path(conn, :home)) end end Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 11
  • 12. defmodule FirestormWeb.Web.Api.V1.FetchView do use FirestormWeb.Web, :view alias FirestormData.Category import Ecto.Query alias FirestormWeb.Web.Api.V1.HomeView def render("index.json", %{categories: categories, users: users, threads: threads, posts: posts}) do %{ categories: Enum.map(categories, &HomeView.category_json/1), threads: Enum.map(threads, &HomeView.thread_json/1), posts: Enum.map(posts, &HomeView.post_json/1), users: Enum.map(users, &HomeView.user_json/1) } end end Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 12
  • 13. defmodule FirestormWeb.Web.Router do use FirestormWeb.Web, :router pipeline :browser do plug :accepts, ["html"] plug :fetch_session # , fetch_flash, protect_from_forgery, put_secure_browser_headers plug FirestormWeb.Plugs.CurrentUser end scope "/", FirestormWeb.Web do pipe_through :browser # Use the default browser stack get "/", PageController, :index get "/home", PageController, :home post "/categories/:id/tag", CategoryController, :tag resources "/categories", CategoryController do post "/threads/:id/tag", ThreadController, :tag get "/threads/:id/follow", ThreadController, :follow get "/threads/:id/unfollow", ThreadController, :unfollow resources "/threads", ThreadController do resources "/posts", PostController end end end Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 13
  • 14. PlugElm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 14
  • 15. A delightful language for reliablewebapps. ElmElm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 15
  • 16. Functional!Strongly Typed! No runtime errors! The Elm Architecture! Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 16
  • 17. Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 17
  • 18. Basic Elmapp(everyone needs a counter, right?) Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 18
  • 19. type alias Model = Int type CounterMsg = Increment | Decrement Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 19
  • 20. update : CounterMsg -> Model -> Model update msg model = case msg of Decrement -> model - 1 Increment -> model + 1 Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 20
  • 21. view : Model -> Html CounterMsg view model = div [] [ button [ onClick Decrement ] [ text "-" ] , div [] [ text (toString model) ] , button [ onClick Increment ] [ text "+" ] ] Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 21
  • 22. BriefMarketingAside Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 22
  • 23. Beabetter developer Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 23
  • 24. www.dailydrip.com Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 24
  • 25. DailyContinuing Education for Developers Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 25
  • 26. www.dailydrip.com Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 26
  • 27. / BriefMarketing Aside Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 27
  • 28. An open-source Phoenix-based Forumwithan Elm frontend Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 28
  • 29. » http://github.com/dailydrip/firestorm » http://firestorm-dogfood.herokuapp.com Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 29
  • 30. DesignWalkthrough Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 30
  • 31. Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 31
  • 32. Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 32
  • 33. Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 33
  • 34. Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 34
  • 35. Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 35
  • 36. Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 36
  • 37. Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 37
  • 38. Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 38
  • 39. Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 39
  • 40. Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 40
  • 41. / DesignWalkthrough Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 41
  • 42. Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 42
  • 43. DATAElm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 43
  • 44. WEBElm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 44
  • 45. NOTIFIER Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 45
  • 46. The neat API or stupid?» JSON-API meets GraphQL... » ...then abandons reason Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 46
  • 47. The neat API or stupid?» JSON-API meets GraphQL... » ...then abandons reason Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 46
  • 48. The neat API or stupid?» JSON-API meets GraphQL... » ...then abandons reason Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 46
  • 49. firestorm_elm An Elm client for Firestorm Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 47
  • 50. view : Store.Model -> User.Model -> Thread.Model -> Html msg view store user thread = div [ class "layout-content" ] [ div [ class "thread-header" ] [ h2 [] [ text thread.title ] , div [ class "item-metadata" ] [ a [ href "#", class "username" ] [ text <| "@" ++ user.username ] ] ] , ol [ class "post-list" ] (List.map (postListItem store) (postsFor store.posts thread)) ] Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 48
  • 51. view : Store.Model -> User.Model -> Thread.Model -> Html msg view store user thread = layoutContent [ threadHeader thread user , postList store (postsFor store.posts thread) ] Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 49
  • 52. layoutContent : List (Html msg) -> Html msg layoutContent = div [ class "layout-content" ] Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 50
  • 53. postList : Store.Model -> List Post.Model -> Html msg postList store posts = posts |> List.map (postListItem store) |> ol [ class "post-list" ] Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 51
  • 54. threadHeader : Thread.Model -> User.Model -> Html msg threadHeader thread user = div [ class "thread-header" ] [ h2 [] [ text thread.title ] , div [ class "item-metadata" ] [ a [ href "#", class "username" ] [ text <| "@" ++ user.username ] ] ] Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 52
  • 55. module View.Threads.Show exposing (view) -- ... import Components exposing (threadHeader, postList, layoutContent) view : Store.Model -> User.Model -> Thread.Model -> Html msg view store user thread = layoutContent [ threadHeader thread user , postList store (postsFor store.posts thread) ] postsFor : Dict Int Post.Model -> Thread.Model -> List Post.Model postsFor posts thread = posts |> Dict.filter (k v -> List.member k thread.postIds) |> Dict.toList |> List.map (( k, v ) -> v) Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 53
  • 56. -- ... import Components exposing (threadHeader, postList, layoutContent) view : Store.Model -> User.Model -> Thread.Model -> Html msg view store user thread = layoutContent [ threadHeader thread user , store |> Store.postsForThread thread |> postList store ] Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 54
  • 57. Local Database SliverElm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 55
  • 58. module Types.Store exposing ( Model) type alias Model = { categories : Dict Int Category.Model , threads : Dict Int Thread.Model , users : Dict Int User.Model , posts : Dict Int Post.Model , wants : ReplenishRequest } Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 56
  • 59. type alias ReplenishRequest = { categories : List Int , threads : List Int , posts : List Int , users : List Int } type alias StoreUpdate = { categories : Dict Int Category.Model , threads : Dict Int Thread.Model , users : Dict Int User.Model , posts : Dict Int Post.Model } Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 57
  • 60. APIInteractionElm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 58
  • 61. index : String -> (StoreUpdate -> msg) -> (Http.Error -> msg) -> Cmd msg index apiBaseUrl tagger errorTagger = "home" |> get apiBaseUrl |> withExpect (Http.expectJson storeUpdateDecoder) |> send (handleGetHomeComplete tagger errorTagger) Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 59
  • 62. Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 60
  • 63. Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 61
  • 64. Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 62
  • 65. Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 63
  • 66. Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 64
  • 67. Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 65
  • 68. post : ReplenishRequest -> String -> (StoreUpdate -> msg) -> (Http.Error -> msg) -> Cmd msg post replenishRequest apiBaseUrl tagger errorTagger = "fetch" |> AH.post apiBaseUrl |> withJsonBody (encodeReplenishRequest replenishRequest) |> withExpect (Http.expectJson storeUpdateDecoder) |> send (handleGetComplete tagger errorTagger) Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 66
  • 69. It's FastElm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 67
  • 70. DemoElm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 68
  • 71. Downsides Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 69
  • 72. Solutions, kindaBut really we want realtime and the HTTP API will never get us, so we move to Channels. Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 70
  • 73. Channels Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 71
  • 74. Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 72
  • 75. Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 73
  • 76. Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 74
  • 77. Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 75
  • 78. Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 76
  • 79. Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 77
  • 80. Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 78
  • 81. Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 79
  • 82. Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 80
  • 83. Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 81
  • 84. GARBAGE COLLECTION ON THE CLIENTElm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 82
  • 85. WhynotGraphQL?“I dream of one day building a company that gets sued by or sues Facebook.” Dream big Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 83
  • 86. Elm is so simpleitguidesyouto solutions @opsb Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 84
  • 87. Althoughalanguage can neverteach aprogrammer whatconstitutesawell-designed program, Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 85
  • 88. it can guide him intothinkingaboutthe rightthings. From the paper AbstractDataTypes by Barbara Liskov and Stephen Zilles Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 86
  • 89. Use Elmwith Phoenix Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 87
  • 90. It'sa great guide Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 88
  • 91. Fin.Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 89
  • 92. This slide intentionallyleftblank. Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 90
  • 93. Geezus stopadvancingthis presentation. Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 91
  • 94. AMøøse once bitmysister Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 92
  • 95. Dangitthe nextslide is literally justmyvim modelinethere's nothing moreto see I swear. Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 93
  • 96. Dangyouto heck. vim:tw=1000 Elm and Phoenix: Two Great Flavors That Taste Great Together DailyDrip.com 94