Skip to content

Commit

Permalink
refactor: load ld if not loaded (#454)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewwylde authored Mar 5, 2024
1 parent be0f312 commit 79e29d2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/composables/useLaunchDarkly.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ async function loadDeps () {
}
} catch (e) {
// ignore failure to import as it's an optional dependency
console.error(e)
}
}
}
Expand All @@ -33,6 +34,10 @@ export default function useLaunchDarkly () {
return
}

if (!ldModule) {
await loadDeps()
}

try {
ldClient = ldModule.initialize(
featuresetId.value,
Expand Down

0 comments on commit 79e29d2

Please sign in to comment.