tejasajmera commented on a change in pull request #6358:
URL: https://github.com/apache/incubator-pinot/pull/6358#discussion_r544535360
##########
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:
I had considered but did not do it because of 2 reasons:-
1. Because it is a temporary implementation until we have API ready to be
able to do deep-linking. It is expected to go away.
2. Because if it turns out to be an implementation which lingers for a for
longer due to unavailability of API in 1. above for a longer duration for any
reason, then we don't want to do any additional initial refactoring as we
transition to ember-octane. The more the services and computed properties, more
tedious the refactoring effort.
Essentially, my idea is we want to keep new code lightweight and use as much
vanilla javascript as we could to make our life easier as we transition towards
ember octane. That means temporarily less reliance on native ember routines,
services, computed properties and such.
----------------------------------------------------------------
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:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]