mirror of
https://github.com/getformwork/formwork.git
synced 2025-01-17 21:49:04 +01:00
Use Map instead of Object
This commit is contained in:
parent
4242711864
commit
40ef6408a7
2
panel/assets/js/app.min.js
vendored
2
panel/assets/js/app.min.js
vendored
File diff suppressed because one or more lines are too long
@ -1,10 +1,10 @@
|
||||
import { app } from "../app";
|
||||
|
||||
const cache = {};
|
||||
const cache = new Map();
|
||||
|
||||
export function passIcon(icon, callback) {
|
||||
if (icon in cache) {
|
||||
callback(cache[icon]);
|
||||
if (cache.has(icon)) {
|
||||
callback(cache.get(icon));
|
||||
return;
|
||||
}
|
||||
|
||||
@ -13,7 +13,7 @@ export function passIcon(icon, callback) {
|
||||
request.onload = function () {
|
||||
const data = this.status === 200 ? this.response : "";
|
||||
if (data !== "") {
|
||||
cache[icon] = data;
|
||||
cache.set(icon, data);
|
||||
}
|
||||
callback(data);
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user