Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddItemMsg ¶
type AddItemMsg struct{}
type ClearCompleted ¶
type ClearCompleted struct{}
ClearCompleted is an action which clears the completed items.
type FilterButton ¶
type FilterButton struct { masc.Core Label string `masc:"prop"` Filter FilterState `masc:"prop"` ActiveFilter bool }
FilterButton is a masc.Component which allows the user to select a filter state.
func (*FilterButton) Copy ¶
func (b *FilterButton) Copy() masc.Component
func (*FilterButton) Render ¶
func (b *FilterButton) Render(send func(masc.Msg)) masc.ComponentOrHTML
Render implements the masc.Component interface.
type FilterState ¶
type FilterState int
FilterState represents a viewing filter for Todo items in the store.
const ( // All is a FilterState which shows all items. All FilterState = iota // Active is a FilterState which shows only non-completed items. Active // Completed is a FilterState which shows only completed items. Completed )
type ItemView ¶
type ItemView struct { masc.Core Index int `masc:"prop"` Title string `masc:"prop"` Completed bool `masc:"prop"` Editing bool `masc:"prop"` EditTitle string `masc:"prop"` // contains filtered or unexported fields }
ItemView is a masc.Component which represents a single item in the TODO list.
type NewItemTitleMsg ¶
type NewItemTitleMsg struct {
Title string
}
type PageView ¶
type PageView struct { masc.Core Items []*Item `masc:"prop"` // Filter represents the active viewing filter for items. Filter FilterState // contains filtered or unexported fields }
PageView is a masc.Component which represents the entire page.
func (*PageView) ActiveItemCount ¶
ActiveItemCount returns the current number of items that are not completed.
func (*PageView) CompletedItemCount ¶
CompletedItemCount returns the current number of items that are completed.
type SetAllCompleted ¶
type SetAllCompleted struct {
Completed bool
}
SetAllCompleted is an action which marks all existing items as being completed or not.
type SetFilter ¶
type SetFilter struct {
Filter FilterState
}
SetFilter is an action which sets the filter for the viewed items.