Improve UI performance by optimizing reactivity
- Replace `ref`s with `shallowRef` when deep reactivity is not needed. - Replace `readonly`s with `shallowReadonly` where the goal is to only prevent `.value` mutation. - Remove redundant `ref` in `SizeObserver.vue`. - Remove redundant nested `ref` in `TooltipWrapper.vue`. - Remove redundant `events` export from `UseCollectionState.ts`. - Remove redundant `computed` from `UseCollectionState.ts`. - Remove `timestamp` from `TreeViewFilterEvent` that becomes unnecessary after using `shallowRef`. - Add missing unit tests for `UseTreeViewFilterEvent`. - Add missing stub for `FilterChangeDetails`.
This commit is contained in:
@@ -2,14 +2,6 @@ import type { ReadOnlyTreeNode } from '../Node/TreeNode';
|
||||
|
||||
export interface TreeViewFilterEvent {
|
||||
readonly action: TreeViewFilterAction;
|
||||
/**
|
||||
* A simple numeric value to ensure uniqueness of each event.
|
||||
*
|
||||
* This property is used to guarantee that the watch function will trigger
|
||||
* even if the same filter action value is emitted consecutively.
|
||||
*/
|
||||
readonly timestamp: Date;
|
||||
|
||||
readonly predicate?: TreeViewFilterPredicate;
|
||||
}
|
||||
|
||||
@@ -25,7 +17,6 @@ export function createFilterTriggeredEvent(
|
||||
): TreeViewFilterEvent {
|
||||
return {
|
||||
action: TreeViewFilterAction.Triggered,
|
||||
timestamp: new Date(),
|
||||
predicate,
|
||||
};
|
||||
}
|
||||
@@ -33,6 +24,5 @@ export function createFilterTriggeredEvent(
|
||||
export function createFilterRemovedEvent(): TreeViewFilterEvent {
|
||||
return {
|
||||
action: TreeViewFilterAction.Removed,
|
||||
timestamp: new Date(),
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user