This commit is contained in:
orion 2023-10-06 18:37:34 -05:00
parent 97c6edb860
commit 00f055cfeb
Signed by: orion
GPG Key ID: 6D4165AE4C928719

View File

@ -22,7 +22,14 @@ this frontend app:
1. fetches data from a server
1. if ok, render items in a list. if error, render error span at the bottom of the page.
**React**
<table>
<thead>
<td><b>React</b></td>
<td><b>Halogen</b></td>
<thead>
<tr>
<td>
```javascript
export const App = () => {
const [items, setItems] = React.useState(undefined)
@ -50,7 +57,9 @@ export const App = () => {
}
```
**Halogen**
</td>
<td>
```haskell
type Item = {id :: String, title :: String, description :: String}
data State = StateEmpty | StateErrored Error | StateGotItems (Array Item)
@ -78,3 +87,9 @@ app = mkComponent
, eval: mkEval (defaultEval {handleAction = action, initialize: Just Init})
}
```
</td>
</tr>
<tbody>
</tbody>
</table>