:ramen: ⚡ miso-fetch

March 8, 2026 · View on GitHub

image

Usage

----------------------------------------------------------------------------
data Action
  = FetchGitHub
  | SetGitHub (Response GitHub)
  | ErrorHandler (Response MisoString)
----------------------------------------------------------------------------
app :: App Model Action
app = component emptyModel updateModel viewModel
----------------------------------------------------------------------------
updateModel :: Action -> Effect ROOT Model Action
updateModel = \case
  FetchGitHub ->
    getJSON "https://api.github.com" [] SetGitHub ErrorHandler
  SetGitHub Response {..} ->
    info ?= body
  ErrorHandler Response {..} ->
    io_ (consoleError body)
----------------------------------------------------------------------------

Build and run

Install Nix Flakes, then:

nix develop .#wasm
make
make serve