Skip to content

Commit

Permalink
[17.0][MIG] bi_view_editor: Migrate
Browse files Browse the repository at this point in the history
  • Loading branch information
antoniodavid committed Jan 24, 2025
1 parent f44a324 commit 6127826
Showing 1 changed file with 5 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,11 @@ export class BiViewEditor extends Component {
}
return model_data;
}
uniqueId(prefix) {
// Default, because we wan't to handle below ES6
prefix = typeof prefix !== "undefined" ? prefix : "$uniqueId$";
if (!this.uniqueIdCounter[prefix]) {
this.uniqueIdCounter[prefix] = 0;
}
var id = ++this.uniqueIdCounter[prefix];
if (prefix === "$uniqueId$") {
return id.toString();
}
return prefix + id;
// Replace the original loadash _.uniqueId function with a custom one that
uniqueId(prefix = "$uniqueId$") {
this.uniqueIdCounter[prefix] = this.uniqueIdCounter[prefix] || 0;
const id = ++this.uniqueIdCounter[prefix];
return prefix === "$uniqueId$" ? id.toString() : `${prefix}${id}`;
}

// WARNING: This is not a drop in replacement solution and
Expand Down

0 comments on commit 6127826

Please sign in to comment.