file-selector icon indicating copy to clipboard operation
file-selector copied to clipboard

refactor!: split file input `change` event into seperate function

Open jonkoops opened this issue 10 months ago • 1 comments

What kind of change does this PR introduce?

  • [ ] Bug Fix
  • [ ] Feature
  • [x] Refactoring
  • [ ] Style
  • [ ] Build
  • [ ] Chore
  • [ ] Documentation
  • [ ] CI

Did you add tests for your changes?

  • [x] Yes, my code is well tested
  • [ ] Not relevant

If relevant, did you update the documentation?

  • [x] Yes, I've updated the documentation
  • [ ] Not relevant

Summary This PR is a continuation of #126 and removes the handling of the change event from the fromEvent() function, and moves it to a dedicated fromChangeEvent() function purposefully made for handling this specific event.

This reduces the need to handle polymorphic input and narrow down what the exact type should be in fromEvent(), in this case also removing the need for this operation to be async. Additionally, this allows bundlers to more effectively tree-shake the module in case the other code is never used. The JSDoc on the function itself has also been improved with additional details for the consumer.

Does this PR introduce a breaking change? Yes, change events are now handled in a dedicated fromChangeEvent() function. Users that were previously using fromEvent() will now have to use this dedicated function instead.

Other information Not applicable.

jonkoops avatar Feb 24 '25 13:02 jonkoops

Pull Request Test Coverage Report for Build 13499636153

Details

  • 4 of 4 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 100.0%

Totals Coverage Status
Change from base Build 13480585681: 0.0%
Covered Lines: 93
Relevant Lines: 93

💛 - Coveralls

coveralls avatar Feb 24 '25 13:02 coveralls