VUE, can you tell us why there is another promise? on the outside of this axios?

The response.data returned by

axios can be used, but why is there another layer of promise? on the outside? Isn"t it more troublesome to write like this when using
? The question I encountered yesterday just saw a person ask the same question, but that person didn"t post the code. I posted the code. Can you explain why you did it? Thank you

get().then(data => {
   console.log(data)
})
  
export function get (url, data = {}) {
  return new Promise((resolve, reject) => {
    axios.get(url, {params: data})
      .then(response => {
        resolve(response.data)
      }, err => {
        reject(err)
      })
  })
}
Feb.01,2022

package a layer Promise there is absolutely no need for superfluous action

  

can increase the burden of js engine gc and reserve optimization space for asking Party A for money in the future.
also adds redundant code, which can reduce the readability of the code and increase the difficulty of maintenance, making it easy for companies not to fire themselves.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e974c4-1646.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e974c4-1646.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?