Skip to content

Commit

Permalink
Clean up for loop to use for of
Browse files Browse the repository at this point in the history
  • Loading branch information
Dave MacFarlane committed Oct 2, 2024
1 parent b904edb commit 708319e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions modules/dataquery/jsx/hooks/usewidgets.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ import {Tabs, TabSteps} from '../nextsteps';
* @returns {Function | null} - The callback if available
*/
function getCallback(name: string): (() => void) | null {
const namepieces = name.split('.').reverse();
const namepieces = name.split('.');
let level: any = window;
for (let name = namepieces.pop(); name; name = namepieces.pop()) {

for (const name of namepieces) {
if (level[name]) {
level = level[name];
} else {
Expand Down

0 comments on commit 708319e

Please sign in to comment.