You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by GitBox <gi...@apache.org> on 2020/12/23 11:09:00 UTC

[GitHub] [cordova-plugin-file] BendingBender opened a new pull request #449: feat: Extend FileReader to conform with EventTarget interface

BendingBender opened a new pull request #449:
URL: https://github.com/apache/cordova-plugin-file/pull/449


   <!--
   Please make sure the checklist boxes are all checked before submitting the PR. The checklist is intended as a quick reference, for complete details please see our Contributor Guidelines:
   
   http://cordova.apache.org/contribute/contribute_guidelines.html
   
   Thanks!
   -->
   
   ### Platforms affected
   All.
   
   
   ### Motivation and Context
   Currently, `cordova-plugin-file`'s `FileReader` doesn't correctly implement the `EventTarget` interface. What works are listeners attached via `on[event]` properties, like `onloadend`. What doesn't work are listeners attached via `addEventListener('loadend', ...)`, they are simply never called.
   
   Some libraries depend upon `FileReader` to implement the `EventTarget` interface. One such library is the Elm File package, it attaches events to `FileReader` via `addEventListener('loadend', ...)` (see https://github.com/elm/file/blob/1.0.5/src/Elm/Kernel/File.js#L155).
   
   ### Description
   The implmentations of `FileReader` was changes so that events attached via `EventTarget`'s `addEventListener()` method are called just like the listeners attached via `on[event]` properties.
   
   
   ### Testing
   This change has been in out cordova app in production for a while, without negative effects.
   
   
   
   ### Checklist
   
   - [x] I've run the tests to see all new and existing tests pass
   - [ ] I added automated test coverage as appropriate for this change
   - [ ] Commit is prefixed with `(platform)` if this change only applies to one platform (e.g. `(android)`)
   - [ ] If this Pull Request resolves an issue, I linked to the issue in the text above (and used the correct [keyword to close issues using keywords](https://help.github.com/articles/closing-issues-using-keywords/))
   - [ ] I've updated the documentation if necessary
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org