WorkboxEvent.mjs 597 B

123456789101112131415161718192021222324252627
  1. /*
  2. Copyright 2019 Google LLC
  3. Use of this source code is governed by an MIT-style
  4. license that can be found in the LICENSE file or at
  5. https://opensource.org/licenses/MIT.
  6. */
  7. import '../_version.mjs';
  8. /**
  9. * A minimal `Event` subclass shim.
  10. * This doesn't *actually* subclass `Event` because not all browsers support
  11. * constructable `EventTarget`, and using a real `Event` will error.
  12. * @private
  13. */
  14. class WorkboxEvent {
  15. /**
  16. * @param {string} type
  17. * @param {Object} props
  18. */
  19. constructor(type, props) {
  20. Object.assign(this, props, {type});
  21. }
  22. }
  23. export {WorkboxEvent};