we have a react-particles-js component onto which the user can add particles by clicking. We wanted to have a maximum number of particles the user is able to add. Mostly so that the user cannot crash their browser 😁
This PR adds a new parameter max to particles.number.
For example:
particles: {
number: {
value: 40,
max: 50
}
}
will limit the number of pushable particles to 50.
You can add the max value to a value <= 0 to have unlimited particles. The default is -1 (unlimited)
Hi,
we have a
react-particles-js
component onto which the user can add particles by clicking. We wanted to have a maximum number of particles the user is able to add. Mostly so that the user cannot crash their browser 😁This PR adds a new parameter
max
toparticles.number
.For example:
will limit the number of pushable particles to 50.
You can add the
max
value to a value<= 0
to have unlimited particles. The default is-1
(unlimited)You can test it out here: Demo Sandbox: https://codesandbox.io/s/v05zx2r8r7
Feedback appreciated 👍
Take care and keep on rocking!