Skip to content
This repository was archived by the owner on Oct 11, 2025. It is now read-only.

Commit 188c9dd

Browse files
committed
Add reflex-todomvc
1 parent d391ad3 commit 188c9dd

File tree

6 files changed

+374
-1
lines changed

6 files changed

+374
-1
lines changed

app/App.hs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ module App (start) where
22

33
import GHC.Wasm.Prim
44
import Language.Javascript.JSaddle (JSM)
5+
import Reflex.TodoMVC qualified
56
import SimpleCounter qualified
67
import Snake qualified
78
import TodoMVC qualified
@@ -16,4 +17,5 @@ start e =
1617
"todomvc" -> TodoMVC.start
1718
"xhr" -> XHR.start
1819
"2048" -> TwoZeroFourEight.start
20+
"reflex-todomvc" -> Reflex.TodoMVC.main
1921
_ -> fail "unknown example"

cabal.project

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
packages: . hs2048
1+
packages: . hs2048 reflex-todomvc
22

33
index-state: 2024-10-20T13:44:33Z
44

@@ -19,3 +19,14 @@ if arch(wasm32)
1919

2020
package aeson
2121
flags: -ordered-keymap
22+
23+
-- for reflex-frp
24+
25+
-- GHC 9.10 compat
26+
source-repository-package
27+
type: git
28+
location: https://github.com/amesgen/reflex-dom
29+
tag: e43e0525d643f656a0a5b0f10e13e2a04712cd4e
30+
subdir: reflex-dom-core
31+
32+
allow-newer: dependent-sum-template:template-haskell

frontend/reflex-todomvc.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1">
6+
<title>TodoMVC | Reflex FRP example via GHC WASM</title>
7+
</head>
8+
<body>
9+
<script>globalThis.example = "reflex-todomvc";</script>
10+
<script src="index.js" type="module"></script>
11+
</body>
12+
</html>

ghc-wasm-miso-examples.cabal

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ executable ghc-wasm-miso-examples
1515
, miso
1616
, mtl
1717
, random
18+
, reflex-todomvc
1819
, text
1920
hs-source-dirs: app
2021
default-language: GHC2021
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
Cabal-version: 3.0
2+
Name: reflex-todomvc
3+
Version: 0.1
4+
Synopsis: Functional Reactive TodoMVC
5+
Description: An implementation of the TodoMVC specification using the Reflex-DOM functional reactive DOM library
6+
License: BSD-3-Clause
7+
License-file: LICENSE
8+
Author: Ryan Trinkle
9+
Maintainer: [email protected]
10+
Stability: Experimental
11+
Category: FRP
12+
13+
library
14+
hs-source-dirs: src
15+
build-depends:
16+
base,
17+
reflex,
18+
ghcjs-dom == 0.9.*,
19+
reflex-dom-core,
20+
containers,
21+
text,
22+
mtl
23+
exposed-modules:
24+
Reflex.TodoMVC
25+
ghc-options: -Wall -fwarn-tabs -funbox-strict-fields -O2

0 commit comments

Comments
 (0)