zhangloo333 commented on a change in pull request #6358:
URL: https://github.com/apache/incubator-pinot/pull/6358#discussion_r543784646



##########
File path: thirdeye/thirdeye-frontend/app/utils/pub-sub.js
##########
@@ -0,0 +1,72 @@
+/** A very lightweight pub-sub implementation to communicate between 
ember-model-table
+ *  and the hosting component
+ *
+ *  Usage:
+ *  import pubSub from 'app/utils/pub-sub';
+ *
+ *  For publishing
+ *  pubSub.publish('testEvent', data);
+ *
+ *  For subscribing
+ *  const subscription = pubSub.subscribe('testEvent', (data) => {
+ *  });
+ *
+ *  For unsubscribing
+ *  subscription.unSubscribe();
+ */
+class PubSub {

Review comment:
       why you need a singleton to create an observer and subscriber here not 
an ember service and computed property to execute it?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to