Skip to content

Commit

Permalink
Use structuredClone instead of deep copy
Browse files Browse the repository at this point in the history
  • Loading branch information
shefalijoshi committed Jan 17, 2025
1 parent 5094c19 commit d241640
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/api/time/TimeAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,7 @@ class TimeAPI extends GlobalTimeContext {
}

// Also emit the mode in case it's different from the previous time context
timeContext.emit(
TIME_CONTEXT_EVENTS.modeChanged,
JSON.parse(JSON.stringify(timeContext.getMode()))
);
timeContext.emit(TIME_CONTEXT_EVENTS.modeChanged, structuredClone(timeContext.getMode()));

// Notify any nested views to update, pass in the viewKey so that particular view can skip getting an upstream context
this.emit('refreshContext', key);
Expand Down

0 comments on commit d241640

Please sign in to comment.