No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.esm2017.js 2.6KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. import firebase from '@firebase/app-compat';
  2. import { Component } from '@firebase/component';
  3. import { trace } from '@firebase/performance';
  4. /**
  5. * @license
  6. * Copyright 2020 Google LLC
  7. *
  8. * Licensed under the Apache License, Version 2.0 (the "License");
  9. * you may not use this file except in compliance with the License.
  10. * You may obtain a copy of the License at
  11. *
  12. * http://www.apache.org/licenses/LICENSE-2.0
  13. *
  14. * Unless required by applicable law or agreed to in writing, software
  15. * distributed under the License is distributed on an "AS IS" BASIS,
  16. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  17. * See the License for the specific language governing permissions and
  18. * limitations under the License.
  19. */
  20. class PerformanceCompatImpl {
  21. constructor(app, _delegate) {
  22. this.app = app;
  23. this._delegate = _delegate;
  24. }
  25. get instrumentationEnabled() {
  26. return this._delegate.instrumentationEnabled;
  27. }
  28. set instrumentationEnabled(val) {
  29. this._delegate.instrumentationEnabled = val;
  30. }
  31. get dataCollectionEnabled() {
  32. return this._delegate.dataCollectionEnabled;
  33. }
  34. set dataCollectionEnabled(val) {
  35. this._delegate.dataCollectionEnabled = val;
  36. }
  37. trace(traceName) {
  38. return trace(this._delegate, traceName);
  39. }
  40. }
  41. const name = "@firebase/performance-compat";
  42. const version = "0.2.1";
  43. /**
  44. * @license
  45. * Copyright 2020 Google LLC
  46. *
  47. * Licensed under the Apache License, Version 2.0 (the "License");
  48. * you may not use this file except in compliance with the License.
  49. * You may obtain a copy of the License at
  50. *
  51. * http://www.apache.org/licenses/LICENSE-2.0
  52. *
  53. * Unless required by applicable law or agreed to in writing, software
  54. * distributed under the License is distributed on an "AS IS" BASIS,
  55. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  56. * See the License for the specific language governing permissions and
  57. * limitations under the License.
  58. */
  59. function registerPerformanceCompat(firebaseInstance) {
  60. firebaseInstance.INTERNAL.registerComponent(new Component('performance-compat', performanceFactory, "PUBLIC" /* ComponentType.PUBLIC */));
  61. firebaseInstance.registerVersion(name, version);
  62. }
  63. function performanceFactory(container) {
  64. const app = container.getProvider('app-compat').getImmediate();
  65. // The following call will always succeed.
  66. const performance = container.getProvider('performance').getImmediate();
  67. return new PerformanceCompatImpl(app, performance);
  68. }
  69. registerPerformanceCompat(firebase);
  70. //# sourceMappingURL=index.esm2017.js.map