Module todo
Interface digest 802bcf6ddfbd5c3c9b46e30414902831 · 1/19 published names documented
Types
Id
type Id = newtype[Str]
Todo
model Todo
| Field | |
|---|---|
id: Id | |
text: Str | |
done: Bool | |
owner: Str |
State
model State
| Field | |
|---|---|
todos: Map[Id, Todo] |
Command
union Command
| Variant | |
|---|---|
Add(id: Id, text: Str) | |
Toggle(id: Id) | |
Delete(id: Id) |
Event
union Event
| Variant | |
|---|---|
Added(id: Id, text: Str) | |
Toggled(id: Id) | |
Deleted(id: Id) |
Rejection
union Rejection
| Variant | |
|---|---|
BlankText | |
IdTaken | |
NoSuchTodo | |
NotOwner |
Names
| Name | Runs on | Effects |
|---|---|---|
apply_event | any | no effects |
done_class | any | no effects |
events | server | no effects |
if_owned | any | no effects |
mine | any | no effects |
page | client | no effects |
proposals | server | ingress |
remaining | any | no effects |
render | any | no effects |
todos | data | durable |
toggled | any | no effects |
validate | any | no effects |
view | any | no effects |
apply_event
apply_event(s: State, env: Envelope[Event]) -> State
defon anyno effects
done_class
done_class(t: Todo) -> Str
defon anyno effects
Every class this page carries is a utility the compiler knows, so `beck build` emits a rule for each of them and nothing else (`docs/104` §104.4). `done` used to be this program's own name for a rule in `beck-rt`'s hard-coded sheet; `line-through` is the same look with nothing hard-coded.
The shared classes are written once and the one that varies is a name beside them, which is `docs/104` §104.4's own example: `class=[…, done_class(t)]`. Both arms are literals, so the compiler enumerates both and emits a rule for each — following the list, the call and the branch, which is the chain §104.4 item 4 is about.
events
events: Stream[Event]
signalon serverno effects
if_owned
if_owned(s: State, p: Proposal, id: Id, evs: list[Event]) -> Result[list[Event], Rejection]
defon anyno effects
mine
mine(s: State, session: Session) -> list[Todo]
defon anyno effects
page
page: Signal[Html]
signalon clientno effects
proposals
proposals: Stream[Proposal]
signalon serveringress
remaining
remaining(todos: list[Todo]) -> Int
defon anyno effects
render
render(todos: list[Todo], left: Int) -> Html
defon anyno effects
todos
todos: Signal[State]
signalon datadurable
toggled
toggled(s: State, id: Id) -> State
defon anyno effects
validate
validate(s: State, p: Proposal) -> Result[list[Event], Rejection]
defon anyno effects
view
view(s: State, session: Session) -> Html
defon anyno effects