How to use the @firebase/component.ComponentContainer function in @firebase/component

To help you get started, we’ve selected a few @firebase/component examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github maierj / fastlane-action / node_modules / @firebase / app / dist / index.esm2017.js View on Github external
constructor(options, config, firebase_) {
        this.firebase_ = firebase_;
        this.isDeleted_ = false;
        this.name_ = config.name;
        this.automaticDataCollectionEnabled_ =
            config.automaticDataCollectionEnabled || false;
        this.options_ = deepCopy(options);
        this.container = new ComponentContainer(config.name);
        // add itself to container
        this._addComponent(new Component('app', () => this, "PUBLIC" /* PUBLIC */));
        // populate ComponentContainer with existing components
        for (const component of this.firebase_.INTERNAL.components.values()) {
            this._addComponent(component);
        }
    }
    get automaticDataCollectionEnabled() {
github maierj / fastlane-action / node_modules / @firebase / app / dist / index.esm.js View on Github external
function FirebaseAppImpl(options, config, firebase_) {
        var e_1, _a;
        var _this = this;
        this.firebase_ = firebase_;
        this.isDeleted_ = false;
        this.name_ = config.name;
        this.automaticDataCollectionEnabled_ =
            config.automaticDataCollectionEnabled || false;
        this.options_ = deepCopy(options);
        this.container = new ComponentContainer(config.name);
        // add itself to container
        this._addComponent(new Component('app', function () { return _this; }, "PUBLIC" /* PUBLIC */));
        try {
            // populate ComponentContainer with existing components
            for (var _b = __values(this.firebase_.INTERNAL.components.values()), _c = _b.next(); !_c.done; _c = _b.next()) {
                var component = _c.value;
                this._addComponent(component);
            }
        }
        catch (e_1_1) { e_1 = { error: e_1_1 }; }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
            }
            finally { if (e_1) throw e_1.error; }
        }
github maierj / fastlane-action / node_modules / @firebase / app / dist / index.cjs.js View on Github external
function FirebaseAppImpl(options, config, firebase_) {
        var e_1, _a;
        var _this = this;
        this.firebase_ = firebase_;
        this.isDeleted_ = false;
        this.name_ = config.name;
        this.automaticDataCollectionEnabled_ =
            config.automaticDataCollectionEnabled || false;
        this.options_ = util.deepCopy(options);
        this.container = new component.ComponentContainer(config.name);
        // add itself to container
        this._addComponent(new component.Component('app', function () { return _this; }, "PUBLIC" /* PUBLIC */));
        try {
            // populate ComponentContainer with existing components
            for (var _b = tslib.__values(this.firebase_.INTERNAL.components.values()), _c = _b.next(); !_c.done; _c = _b.next()) {
                var component$1 = _c.value;
                this._addComponent(component$1);
            }
        }
        catch (e_1_1) { e_1 = { error: e_1_1 }; }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
            }
            finally { if (e_1) throw e_1.error; }
        }
github maierj / fastlane-action / node_modules / @firebase / app / dist / index.rn.cjs.js View on Github external
function FirebaseAppImpl(options, config, firebase_) {
        var e_1, _a;
        var _this = this;
        this.firebase_ = firebase_;
        this.isDeleted_ = false;
        this.name_ = config.name;
        this.automaticDataCollectionEnabled_ =
            config.automaticDataCollectionEnabled || false;
        this.options_ = util.deepCopy(options);
        this.container = new component.ComponentContainer(config.name);
        // add itself to container
        this._addComponent(new component.Component('app', function () { return _this; }, "PUBLIC" /* PUBLIC */));
        try {
            // populate ComponentContainer with existing components
            for (var _b = tslib.__values(this.firebase_.INTERNAL.components.values()), _c = _b.next(); !_c.done; _c = _b.next()) {
                var component$1 = _c.value;
                this._addComponent(component$1);
            }
        }
        catch (e_1_1) { e_1 = { error: e_1_1 }; }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
            }
            finally { if (e_1) throw e_1.error; }
        }
github firebase / firebase-js-sdk / packages / database / index.node.ts View on Github external
/**
   * This should allow the firebase-admin package to provide a custom version
   * to the backend
   */
  CONSTANTS.NODE_ADMIN = true;
  setSDKVersion(version);

  /**
   * Create a 'auth-internal' component using firebase-admin-node's implementation
   * that implements FirebaseAuthInternal.
   * ComponentContainer('database-admin') is just a placeholder that doesn't perform
   * any actual function.
   */
  const authProvider = new Provider(
    'auth-internal',
    new ComponentContainer('database-admin')
  );
  authProvider.setComponent(
    new Component(
      'auth-internal',
      // firebase-admin-node's app.INTERNAL implements FirebaseAuthInternal interface
      // eslint-disable-next-line @typescript-eslint/no-explicit-any
      () => (app as any).INTERNAL,
      ComponentType.PRIVATE
    )
  );

  return {
    instance: RepoManager.getInstance().databaseFromApp(app, authProvider, url),
    namespace: {
      Reference,
      Query,
github maierj / fastlane-action / node_modules / @firebase / app / dist / index.lite.esm2017.js View on Github external
constructor(options, config, firebase_) {
        this.firebase_ = firebase_;
        this.isDeleted_ = false;
        // lite version has an empty INTERNAL namespace
        this.INTERNAL = {};
        this.name_ = config.name;
        this.automaticDataCollectionEnabled_ =
            config.automaticDataCollectionEnabled || false;
        this.options_ = deepCopy(options);
        this.container = new ComponentContainer(config.name);
        // add itself to container
        this.container.addComponent(new Component('app', () => this, "PUBLIC" /* PUBLIC */));
        // populate ComponentContainer with existing components
        for (const component of this.firebase_.INTERNAL.components.values()) {
            this.container.addComponent(component);
        }
    }
    get automaticDataCollectionEnabled() {
github maierj / fastlane-action / node_modules / @firebase / app / dist / index.lite.js View on Github external
function FirebaseAppLiteImpl(options, config, firebase_) {
        var e_1, _a;
        var _this = this;
        this.firebase_ = firebase_;
        this.isDeleted_ = false;
        // lite version has an empty INTERNAL namespace
        this.INTERNAL = {};
        this.name_ = config.name;
        this.automaticDataCollectionEnabled_ =
            config.automaticDataCollectionEnabled || false;
        this.options_ = deepCopy(options);
        this.container = new ComponentContainer(config.name);
        // add itself to container
        this.container.addComponent(new Component('app', function () { return _this; }, "PUBLIC" /* PUBLIC */));
        try {
            // populate ComponentContainer with existing components
            for (var _b = __values(this.firebase_.INTERNAL.components.values()), _c = _b.next(); !_c.done; _c = _b.next()) {
                var component = _c.value;
                this.container.addComponent(component);
            }
        }
        catch (e_1_1) { e_1 = { error: e_1_1 }; }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
            }
            finally { if (e_1) throw e_1.error; }
        }
github firebase / firebase-js-sdk / packages / app / src / firebaseApp.ts View on Github external
constructor(
    options: FirebaseOptions,
    config: FirebaseAppConfig,
    private readonly firebase_: _FirebaseNamespace
  ) {
    this.name_ = config.name!;
    this.automaticDataCollectionEnabled_ =
      config.automaticDataCollectionEnabled || false;
    this.options_ = deepCopy(options);
    this.container = new ComponentContainer(config.name!);

    // add itself to container
    this._addComponent(new Component('app', () => this, ComponentType.PUBLIC));
    this._addComponent(
      new Component(
        'platform-logger',
        container => new PlatformLoggerService(container),
        ComponentType.PRIVATE
      )
    );
    this._addComponent(
      new Component(
        'app-version',
        () => new VersionService('app', version),
        ComponentType.VERSION
      )
github firebase / firebase-js-sdk / packages / installations / src / testing / fake-generators.ts View on Github external
export function getFakeDependencies(): FirebaseDependencies {
  const container = new ComponentContainer('test');
  container.addComponent(
    new Component(
      'platform-logger',
      () => ({ getPlatformInfoString: () => 'a/1.2.3 b/2.3.4' }),
      ComponentType.PRIVATE
    )
  );

  return {
    appConfig: getFakeAppConfig(),
    platformLoggerProvider: container.getProvider('platform-logger')
  };
}
github firebase / firebase-js-sdk / packages / app / src / next / index.ts View on Github external
automaticDataCollectionEnabled: false,
        ...rawConfig
    };
    const name = config.name;

    if (typeof name !== 'string' || !name) {
        throw ERROR_FACTORY.create(AppError.BAD_APP_NAME, {
            appName: String(name)
        });
    }

    if (apps.has(name)) {
        throw ERROR_FACTORY.create(AppError.DUPLICATE_APP, { appName: name });
    }

    const container = new ComponentContainer(name);
    for (const component of components.values()) {
        container.addComponent(component);
    }

    const newApp = new FirebaseAppImplNext(options, config, container);

    apps.set(name, newApp);

    return newApp;
}

@firebase/component

Firebase Component Platform

Apache-2.0
Latest version published 14 days ago

Package Health Score

95 / 100
Full package analysis

Similar packages