Created
September 13, 2016 15:23
-
-
Save sinmetal/1594c511df202170c49972c23cc019bf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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