WorkboxEvent.js 538 B

1234567891011121314151617181920
  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.js';
  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. export class WorkboxEvent {
  15. constructor(type, props) {
  16. this.type = type;
  17. Object.assign(this, props);
  18. }
  19. }