-
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
fix: default values on removeParticles logic #11374
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your PR title doesn't match the required format. The title should be in this format:
chore: update Text docs
fix: text not rendering
feat: add new feature to Text
breaking: remove Text#resolution
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your PR title doesn't match the required format. The title should be in this format:
chore: update Text docs
fix: text not rendering
feat: add new feature to Text
breaking: remove Text#resolution
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 9d87daf:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your PR title doesn't match the required format. The title should be in this format:
chore: update Text docs
fix: text not rendering
feat: add new feature to Text
breaking: remove Text#resolution
// Default beginIndex to 0 if not provided | ||
const start = beginIndex ?? 0; | ||
// Default endIndex to the length of particleChildren if not provided | ||
const end = endIndex ?? this.particleChildren.length; | ||
// Remove the correct range | ||
const children = this.particleChildren.splice(start, end); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternatively:
// Default beginIndex to 0 if not provided | |
const start = beginIndex ?? 0; | |
// Default endIndex to the length of particleChildren if not provided | |
const end = endIndex ?? this.particleChildren.length; | |
// Remove the correct range | |
const children = this.particleChildren.splice(start, end); | |
// Default beginIndex to 0 if not provided | |
beginIndex ??= 0; | |
// Default endIndex to the length of particleChildren if not provided | |
endIndex ??= this.particleChildren.length; | |
// Remove the correct range | |
const children = this.particleChildren.splice(beginIndex, endIndex); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be considered a breaking change because users may have removeParticles() calls in production. If their pixijs version isn't locked, their next release could exhibit unintentional behavior if they upgrade without thorough testing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tweaked this based on your feedback @bigtimebuddy .
Thanks for youre insight @susiwen8! , whilst it is kind of a breaking change, it also is fixing incorrect behaviour. With that in mind, I think on this occasion its ok not to consider this breaking as the use case would be quite strange!
…oveParticles method
Description of change
update
removeParticles
logic to match description provided. Set the endIndex to default to the container lengthCloses #11357
Pre-Merge Checklist
npm run lint
)npm run test
)