Following the tutorials from this site: http://blog.krawaller.se/posts/the-reflux-data-flow-model/
I'm looking at replacing var chatRef
to a dummy data instead of using new Firebase(...)
as shown in the author example. Baffled how exactly this line read?
chatRef.on("value",this.updateChat.bind(this));
What is "value" and how bind
work?
Tried to use var chatRef = {0: "Hello", 1: "Hello"}
produce Uncaught TypeError: undefined is not a function
chatRef appears to be an event emitter with at least one custom function (push).
You could mock it like this:
If you don't get it, you should read up on event emitters.
For the
.bind
call googleFunction.prototoype.bind
. In this case the bind just ensures that when the callback is called, it has the correctthis
value.