Skip to content

Commit

Permalink
Loader for loadslim init
Browse files Browse the repository at this point in the history
  • Loading branch information
aunshx committed Sep 4, 2024
1 parent e42634f commit a252b40
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 a252b40

Please sign in to comment.