Olli Mahlamäki / Reaktor
var messages = [
{ from: "olli", to: "fernando", text: "Hi Ferkku" },
{ from: "fernando", to: "olli", text: "What's up?" },
{ from: "olli", to: "fernando", text: "Giving a presentation to Aalto ES" },
{ from: "fernando", to: "olli", text: "Ok cool" },
]
messages
.filter(function(message) { return isDirectedToMe(message) })
.map(function(message) { return message.text })
.forEach(show)
var messages = [
{ from: "olli", to: "fernando", text: "Hi Ferkku" },
{ from: "fernando", to: "olli", text: "What's up?" },
{ from: "olli", to: "fernando", text: "Giving a presentation to Aalto ES" },
{ from: "fernando", to: "olli", text: "Ok cool" },
]
// Simulate messages coming from server
var messagesE = Bacon.sequentially(1000, messages)
messagesE
.filter(function(message) { return isDirectedToMe(message) })
.map(function(message) { return message.text })
.forEach(show)