mirror of
https://github.com/jellyfin/jellyfin-vue.git
synced 2024-12-01 02:00:25 +00:00
perf: remove useless structuredClone
Signed-off-by: Fernando Fernández <ferferga@hotmail.com>
This commit is contained in:
parent
2f3fbad706
commit
a252615f56
@ -40,7 +40,11 @@ class ApiStore {
|
||||
items: new Map<BaseItemDto['Id'], BaseItemDto>(),
|
||||
requests: new Map<string, Map<string, unknown | RawBaseItemResponse>>()
|
||||
};
|
||||
private _state = reactive<ApiState>(structuredClone(this._defaultState));
|
||||
/**
|
||||
* Maps can be cleared (see this._clear), so no need to perform an structuredClone
|
||||
* of the defaultState here
|
||||
*/
|
||||
private _state = reactive<ApiState>(this._defaultState);
|
||||
|
||||
public apiEnums = Object.freeze({
|
||||
fields: Object.freeze(Object.values(ItemFields)),
|
||||
@ -143,7 +147,8 @@ class ApiStore {
|
||||
};
|
||||
|
||||
private _clear = (): void => {
|
||||
Object.assign(this._state, this._defaultState);
|
||||
this._state.items.clear();
|
||||
this._state.requests.clear();
|
||||
};
|
||||
|
||||
public constructor() {
|
||||
|
Loading…
Reference in New Issue
Block a user