[Vuejs]-How to use method from promise on condition?

0👍

You should use condition code after promise returns. Like so:

const getCat = () => import("z-mock-client")
const mocked = getCat().then((prop) => {
  prop.mockedClient()
  const apolloProvider = new VueApollo({
    defaultClient: MOCKED_UI ? mocked : v2,
    clients: {
        v2: MOCKED_UI ? mocked : v2
    }
  })
});

Leave a comment