godfat / rest-core

Various rest-builder middleware for building REST clients.
Apache License 2.0
57 stars 13 forks source link

Listen for "child_added" #17

Closed holgersindbaek closed 9 years ago

holgersindbaek commented 9 years ago

Is it possible for me to listen for when a child is added in my firebase with this library? If so, how would you do it?

godfat commented 9 years ago

Yes, please checkout SSE and use rest-firebase for accessing firebase.

holgersindbaek commented 9 years ago

Thanks for the quick response. I don't see where it listens for "child_added" though?

godfat commented 9 years ago

Whenever it happens, it would call your onmessage callback.

es.onmessage{ |event, data, sock| p event, data } # Called for each message

I don't really remember what the event would be, maybe put. Any event for the particular node would be notified.

holgersindbaek commented 9 years ago

Oh, cool. I'll check it out. Thanks again.