You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2020/12/16 00:28:32 UTC

[GitHub] [incubator-pinot] zhangloo333 commented on a change in pull request #6358: [TE]frontend - Add a lightweight PubSub system

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:
users@infra.apache.org



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