coco

package module
v0.0.0-...-f69e5d0 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2019 License: MIT Imports: 6 Imported by: 0

README

🥥 Coco

Golang WebAssembly Framework

App.go

type App struct {
    Counter int
}

func (a App) OnTestClick() {
    a.Counter++
    coco.Set(a)
}

App.html

<div class="Test">
  {{.Counter}}
</div>

App.css

.Test {
  width: 160px;
}

Installation

go get github.com/mrmiguu/coco

Running the example

You should use go-wasm-cli to run this example.

cd $GOPATH/src/github.com/mrmiguu/coco/example
go-wasm start

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Render

func Render(root interface{})

Render renders the root component as the body.

func Set

func Set(comp interface{})

Set sets the diff component and patches the * tree.

Types

type VDOM

type VDOM struct {
	// contains filtered or unexported fields
}

VDOM is the virtual DOM for this package.

func (*VDOM) Render

func (v *VDOM) Render(root interface{})

Render renders the root component as the body.

func (*VDOM) Set

func (v *VDOM) Set(comp interface{})

Set sets the diff component and patches the * tree.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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