Elm support #7856
Replies: 3 comments 2 replies
-
import Browser
import Html exposing (Html, button, div, text)
import Html.Events exposing (onClick)
-- MAIN
main =
Browser.sandbox { init = init, update = update, view = view }
-- MODEL
type alias Model = Int
init : Model
init =
0
-- UPDATE
type Msg = Increment | Decrement
update : Msg -> Model -> Model
update msg model =
case msg of
Increment ->
model + 1
Decrement ->
model - 1
-- VIEW
view : Model -> Html Msg
view model =
div []
[ button [ onClick Decrement ] [ text "-" ]
, div [] [ text (String.fromInt model) ]
, button [ onClick Increment ] [ text "+" ]
]
Basic example of counter with button |
Beta Was this translation helpful? Give feedback.
-
We want to keep create-tauri-app fairly minimal. We made the mistake in its v2 version to add too many templates to it and ended up not being able to maintain them. We do would like to see community template support at some point though, but until them adding templates to https://github.com/tauri-apps/awesome-tauri/ is the way to go. When our new docs go live they will also have a place for community templates :) |
Beta Was this translation helpful? Give feedback.
-
Supporting other languages than JavaScript is actually the main intention behind the In the meantime however, there are templates out there (and as @FabianLars said submit your own if you have created one!) that can serve as a starting point for an elm+tauri setup |
Beta Was this translation helpful? Give feedback.
-
I tried this once, and besides some tweaks here an there is viable since the language generates a SPA by itself, Im talking about using Elm language with tauri to generate a desktop reactive app. The idea came when I was(and still am) using Yew + tauri for a freelance desktop app, since yew has a very similar routine of building pages(creation, event handling, render) as elm(and I think inspired on) I tried for once to mix these to very different universes, and worked very well, is a great DX and elm reactor is awesome like mamas heart, I recommend you trying it. So I came to my mind, why not give support? not that alm really needs much since it has backward compatibility with JS so the
invoke
still viable, but add it to thecreate-tauri-app
command line.Beta Was this translation helpful? Give feedback.
All reactions