sahil-endee commented on code in PR #6437:
URL: https://github.com/apache/texera/pull/6437#discussion_r3790566173


##########
frontend/src/app/workspace/service/joint-ui/joint-ui.service.ts:
##########
@@ -1080,3 +1080,20 @@ export function fromJointPaperEvent<T extends keyof 
joint.dia.Paper.EventMap = k
     (handler, signal) => paper.off(eventName as string, handler, context) // 
removeHandler
   );
 }
+
+/**
+ * Observable of a JointJS graph's cell events (`change:position`, `add`, ...),
+ * emitting the cell the event fired on.
+ *
+ * The graph belongs to `JointGraphWrapper`, which is root-provided, so it
+ * outlives the components listening to it. Going through an Observable lets a
+ * listener be torn down with `untilDestroyed(this)` like any other 
subscription,
+ * where a raw `graph.on(...)` closure would leak.
+ */
+export function fromJointGraphCellEvent(graph: joint.dia.Graph, eventName: 
string): Observable<joint.dia.Cell> {

Review Comment:
   Done



##########
frontend/src/app/workspace/service/joint-ui/joint-ui.service.ts:
##########
@@ -1080,3 +1080,20 @@ export function fromJointPaperEvent<T extends keyof 
joint.dia.Paper.EventMap = k
     (handler, signal) => paper.off(eventName as string, handler, context) // 
removeHandler
   );
 }
+
+/**
+ * Observable of a JointJS graph's cell events (`change:position`, `add`, ...),
+ * emitting the cell the event fired on.
+ *
+ * The graph belongs to `JointGraphWrapper`, which is root-provided, so it
+ * outlives the components listening to it. Going through an Observable lets a
+ * listener be torn down with `untilDestroyed(this)` like any other 
subscription,
+ * where a raw `graph.on(...)` closure would leak.
+ */
+export function fromJointGraphCellEvent(graph: joint.dia.Graph, eventName: 
string): Observable<joint.dia.Cell> {

Review Comment:
   Done



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to