PubSub packed in an angularJS factory