purscript-jelly
仮想DOMを使わない
code:purs(hs)
main = launchApp counter unit
counter :: Component Unit
counter = el "div" do
countSig /\ countAtom <- signal 0
ch $ text do
count <- countSig
pure $ "Counter: " <> show count
ch $ el "button" do
on "click" \_ -> do
modifyAtom_ countAtom (_ + 1)
ch $ text $ pure "Increment"
react hooksとjotaiの感じ
code:purs(hs)
signal :: ∀ m a. MonadEffect m ⇒ a → m (Signal a /\ Atom a)