Skip to content
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

Add array mutation helper #4334

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

haslinghuis
Copy link
Member

@haslinghuis haslinghuis commented Feb 6, 2025

This pull request refactors array manipulation operations in the src/js directory by introducing utility functions and updating existing code to use these new utilities. The changes enhance code readability and maintainability.

Key changes include:

Introduction of Utility Functions:

  • src/js/utils/array.js: Added new utility functions removeArrayElement, addArrayElement, replaceArrayElement, and addArrayElementAfter for common array operations.

Refactoring to Use Utility Functions:

  • src/js/debug.js: Replaced direct array manipulations in the update function with the new utility functions for better readability and maintainability. [1] [2]
  • src/js/sensor_types.js: Updated the sensorTypes function to use the new utility functions instead of inline array manipulation code.

Import Statements:

  • src/js/debug.js and src/js/sensor_types.js: Added import statements for the new utility functions from utils/array. [1] [2]

@haslinghuis haslinghuis added this to the 11.0 milestone Feb 6, 2025
@haslinghuis haslinghuis self-assigned this Feb 6, 2025
Copy link

netlify bot commented Feb 6, 2025

Deploy Preview for origin-betaflight-app ready!

Name Link
🔨 Latest commit c46542e
🔍 Latest deploy log https://app.netlify.com/sites/origin-betaflight-app/deploys/67a53278f7eb6c00081e4ef3
😎 Deploy Preview https://deploy-preview-4334.dev.app.betaflight.com
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@haslinghuis haslinghuis changed the title Add array helper Add array mutation helper Feb 6, 2025
Copy link

sonarqubecloud bot commented Feb 6, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

1 participant