tiagobento commented on code in PR #2720:
URL: 
https://github.com/apache/incubator-kie-tools/pull/2720#discussion_r1923769816


##########
packages/online-editor/src/dmnRunner/DmnRunnerContextProvider.tsx:
##########
@@ -163,6 +166,10 @@ export function DmnRunnerContextProvider(props: 
PropsWithChildren<Props>) {
   const status = useMemo(() => (isExpanded ? DmnRunnerStatus.AVAILABLE : 
DmnRunnerStatus.UNAVAILABLE), [isExpanded]);
   const dmnRunnerAjv = useMemo(() => new DmnRunnerAjv().getAjv(), []);
 
+  const dmnEditor = useMemo(() => props.dmnEditor, [props.dmnEditor]);

Review Comment:
   This line doesn't do much.. it tries to memoize a value based on itself, so 
you can use `props.dmnEditor` directly.



##########
packages/online-editor/src/dmnRunner/DmnRunnerContext.tsx:
##########
@@ -41,6 +42,8 @@ export interface DmnRunnerContextType {
   results: Array<DecisionResult[] | undefined>;
   resultsDifference: Array<Array<object>>;
   status: DmnRunnerStatus;
+  dmnEditor: EmbeddedEditorRef | undefined;
+  isLegacyDmnEditor: boolean;

Review Comment:
   I still don't understand why we need this `isLegacyDmnEditor` property. You 
can remove it and use `useMemo(() => settings.editors.useLegacyDmnEditor, 
[settings.editors.useLegacyDmnEditor]);` everywhere you need 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.

To unsubscribe, e-mail: [email protected]

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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to