Module todo
Interface digest 802bcf6ddfbd5c3c9b46e30414902831 · 0/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
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