Skip to content

How to handle the loading strategy with useScriptLemonSqueezy #195

Closed
@AdamBD

Description

@AdamBD

📚 What are you trying to do?

Hi all,

I am testing with the below code:

<template>
  <div>
    <button @click="openstore">click me</button>
  </div>
</template>

<script setup>
  const { Setup, Url } = useScriptLemonSqueezy()

  const openstore = () => {
    Url.Open(
      "https://mystoreurL",
    )
  }

  onMounted(async () => {
    await Setup({
      eventHandler: lemonCallback,
    })
  })
</script>

On initial page load, when trying to Url.Open call, I get an error saying this function does not exist. If I do client-side navigation to the page or trigger HMR then the function is available.

What is the loading strategy with this module and what is the best way to deal with this?

🔍 What have you tried?

No response

ℹ️ Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions