1
0
mirror of https://github.com/taigrr/wasm-experiments synced 2025-01-18 04:03:21 -08:00

Remove gRPC example, add some simpler examples

This commit is contained in:
Johan Brandhorst
2018-08-11 20:55:13 +01:00
parent 1bb4e7fb1e
commit 0d5389317f
662 changed files with 942 additions and 368637 deletions

17
div/div.go Normal file
View File

@@ -0,0 +1,17 @@
// +build js,wasm
package div
import "github.com/dennwc/dom"
// Writer implements an io.Writer that appends content
// to the dom.Element. It should ideally be used on a <div> element.
type Writer dom.Element
// Write implements io.Writer.
func (d Writer) Write(p []byte) (n int, err error) {
node := dom.GetDocument().CreateElement("div")
node.SetInnerHTML(string(p))
(*dom.Element)(&d).AppendChild(node)
return len(p), nil
}