Turnip is a publisher/subscribe library designed around the concept of UI components needing multipled pieces of data before they can be rendered or updated.
It is based off of d3.dispatch.
var pubsub = new PubSubSystem()
pubsub.publisher("pub_name")
.producer(function(cb){
setTimeout(function(x){
cb({"some":"data"})
},1000)
})
pubsub.publisher("pub_name_with_data")
.producer(function(cb,data){
setTimeout(function(x){
cb({"some_transformed":data})
},1000)
})
var subscription = pubsub.subscriber("name",["x","y"])
pubsub.subscriber("name",["x","y"])
.run(function(x,y){
})
.data({"some":"data"})
.unpersist(true)
.trigger()
subscription
.run(function(x,y){
})
.data({"some":"data"})
.unpersist(true)
.trigger()