Documentation

Index

Constants

This section is empty.

Variables

View Source
var CacheTimeout time.Duration = time.Minute

Functions

func UseHackerNews

func UseHackerNews() *hnclient.Client

func UseStory

func UseStory(id int) (
	story *hnclient.Story,
	loading bool,
	err error,
)

Types

type CurrentStoryState

type CurrentStoryState struct {
	Data    hnclient.Story
	Loading bool
	Error   error
}

func UseCurrentStory

func UseCurrentStory(
	storiesContext *r.Context,
	commentsContext *r.Context,
) (
	CurrentStoryState,
	r.SetState,
)

    UseCurrentStory

    type TopStoriesState

    type TopStoriesState struct {
    	Data    []int
    	Loading bool
    	Error   error
    }

    func UseTopStories

    func UseTopStories() TopStoriesState

      UseTopStories