doc
This commit is contained in:
parent
97c6edb860
commit
00f055cfeb
19
readme.md
19
readme.md
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user