Skip to content

Instantly share code, notes, and snippets.

@sinmetal
Created September 13, 2016 15:23
Show Gist options
  • Save sinmetal/1594c511df202170c49972c23cc019bf to your computer and use it in GitHub Desktop.
Save sinmetal/1594c511df202170c49972c23cc019bf to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
"log"
"github.com/zabawaba99/firego"
)
func main() {
f := firego.New("https://metal-tile-dev.firebaseio.com/map/field", nil)
notifications := make(chan firego.Event)
if err := f.Watch(notifications); err != nil {
log.Fatal(err)
}
defer f.StopWatching()
for event := range notifications {
fmt.Printf("Event %#v\n", event)
}
fmt.Printf("Notifications have stopped")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment