Skip to content

Commit

Permalink
Merge pull request #45 from ResilientApp/v3-b-2
Browse files Browse the repository at this point in the history
Loader for loadslim init
  • Loading branch information
aunshx authored Sep 4, 2024
2 parents e42634f + a252b40 commit b0580e7
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,22 @@ const PreSynthApp = () => {
}

useEffect(() => {
setIsLoading(true);
initParticlesEngine(async (engine) => {
await loadSlim(engine);
}).then(() => {
setInit(true);
setIsLoading(false);
});
})
.then(() => {
setInit(true);
})
.catch((error) => {
console.error("Initialization failed:", error);
})
.finally(() => {
setIsLoading(false);
});
}, []);


return (
<>
<ParticleWrapper init={init} />
Expand Down

0 comments on commit b0580e7

Please sign in to comment.