example

package
v0.0.0-...-917641f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 30, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Generated. DO NOT EDIT.

Index

Constants

This section is empty.

Variables

Functions

func AddTodo

func AddTodo(t *TodoListStream, todo Todo)

func Client

func Client(stop chan struct{}, render func(*TodoListStream))

func SaveSession

func SaveSession(s *dot.Session, todos TodoList)

func Server

func Server()

func SpliceDescription

func SpliceDescription(t *TodoListStream, index, offset, count int, replacement string)

func Toggle

func Toggle(t *TodoListStream, index int)

Types

type Todo

type Todo struct {
	Complete    bool
	Description string
}

Todo tracks a single todo item

func (Todo) Apply

func (t Todo) Apply(ctx changes.Context, c changes.Change) changes.Value

func (Todo) SetComplete

func (t Todo) SetComplete(value bool) Todo

func (Todo) SetDescription

func (t Todo) SetDescription(value string) Todo

type TodoList

type TodoList []Todo

TodoList tracks a collection of todo items

func SavedSession

func SavedSession() (s *dot.Session, todos TodoList)

func (TodoList) Apply

func (TodoList) ApplyCollection

func (t TodoList) ApplyCollection(ctx changes.Context, c changes.Change) changes.Collection

func (TodoList) Count

func (t TodoList) Count() int

Count implements changes.Collection Count() method

func (TodoList) Move

func (t TodoList) Move(offset, count, distance int) TodoList

Move shuffles [offset:offset+count] by distance.

func (TodoList) Slice

func (t TodoList) Slice(offset, count int) changes.Collection

Slice implements changes.Collection Slice() method

func (TodoList) Splice

func (t TodoList) Splice(offset, count int, insert ...Todo) TodoList

Splice replaces [offset:offset+count] with insert...

type TodoListStream

type TodoListStream struct {
	Stream streams.Stream
	Value  TodoList
}

TodoListStream implements a stream of TodoList values

func (*TodoListStream) Item

func (s *TodoListStream) Item(index int) *TodoStream

Item returns the sub item stream

func (*TodoListStream) Latest

func (s *TodoListStream) Latest() *TodoListStream

Latest returns the latest entry in the stream

func (*TodoListStream) Move

func (s *TodoListStream) Move(offset, count, distance int) *TodoListStream

Move shuffles Value[offset:offset+count] over by distance

func (*TodoListStream) Next

Next returns the next entry in the stream if there is one

func (*TodoListStream) Splice

func (s *TodoListStream) Splice(offset, count int, replacement ...Todo) *TodoListStream

Splice splices the items replacing Value[offset:offset+count] with replacement

func (*TodoListStream) Update

func (s *TodoListStream) Update(val TodoList) *TodoListStream

Update replaces the current value with the new value

type TodoStream

type TodoStream struct {
	Stream streams.Stream
	Value  Todo
}

TodoStream implements a stream of Todo values

func (*TodoStream) Complete

func (s *TodoStream) Complete() *streams.Bool

func (*TodoStream) Description

func (s *TodoStream) Description() *streams.S16

func (*TodoStream) Latest

func (s *TodoStream) Latest() *TodoStream

Latest returns the latest entry in the stream

func (*TodoStream) Next

func (s *TodoStream) Next() (*TodoStream, changes.Change)

Next returns the next entry in the stream if there is one

func (*TodoStream) Update

func (s *TodoStream) Update(val Todo) *TodoStream

Update replaces the current value with the new value

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL