OtherKeys fetches information about the labels that contains, either when the ZObject is visualized, or when a new ZObject is being created and new keys are being added.
Currently, on mounting OtherKeys, we do a call to wikilambda_fetch for each key found in this.keyTypes, which sometimes means that it makes this api call for fetching the information of the same ID more than once.
Some improvements on different levels can be:
- The api admits a list of keys, so instead of doing a call in each loop iteration, we can collect those keys and request them together (e.g. Z1|Z2|Z3)
- When seeking the information of a given list of keys, fetch this on a global state handler (Vuex) and let the global state figure out whether the information is available or it needs to be fetched from the api.
Also notice that:
- Currently the labels fetches things that are already present on editingData.zkeylabels with the information of ZTypeRegistry::TEMP_KEY_LABELS_IN_ENGLISH
- We should stop sending all this data at the beginning and limit ourselves to request to the API whatever necessary.