Documentation

Index

Constants

This section is empty.

Variables

View Source
var CommentContext = r.CreateContext(r.State{Comments{}})
View Source
var StoriesContext = r.CreateContext(r.State{Stories{}})

Functions

func Cache

func Cache(p r.Properties) r.Element

Types

type CommentItem

type CommentItem struct {
	Comment     *hnclient.Comment
	Loading     bool
	Error       error
	LastUpdated time.Time
}

type Comments

type Comments struct {
	Cache  map[int]CommentItem
	Update func(id int, item CommentItem)
}

type Stories

type Stories struct {
	Cache  map[int]StoryItem
	Update func(id int, item StoryItem)
}

func (*Stories) Get

func (c *Stories) Get(id int) StoryItem

type StoryItem

type StoryItem struct {
	Story       *hnclient.Story
	Loading     bool
	Error       error
	LastUpdated time.Time
}

Source Files