當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript ReduxPackageCombiner.configure方法代碼示例

本文整理匯總了TypeScript中redux-package.ReduxPackageCombiner.configure方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript ReduxPackageCombiner.configure方法的具體用法?TypeScript ReduxPackageCombiner.configure怎麽用?TypeScript ReduxPackageCombiner.configure使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在redux-package.ReduxPackageCombiner的用法示例。


在下文中一共展示了ReduxPackageCombiner.configure方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: beforeEach

    beforeEach(() => {
      let featureToggleModule: FeatureTogglePackage = new FeatureTogglePackage();
      ReduxPackageCombiner.reset();
      ReduxPackageCombiner.configure([featureToggleModule], null);
      toggleRouter = new ToggleRouter(ReduxPackageCombiner.getDispatcher());

      const configs = {
        'cta': {setting: 'contact'}
      };
      FeatureToggleActions.initialize(configs);

      toggleSetting$ = toggleRouter.watch('cta');
      toggleSetting$.subscribe((newValue) => {
        watched(newValue);
      });

      toggleRouter.setFeatureState({cta: 'value'});

    });
開發者ID:kokokenada,項目名稱:common-app,代碼行數:19,代碼來源:feature-toggle-router.spec.ts

示例2: configure

  configure(middleware) {

    let connectService: IConnectService;
    let loginService: ILoginService;
    let usersService: IUsersService;
    let uploaderService: IUploaderService;
    let startGameService: IGameStartService;
    let gamePlayServiceMeteor: IGamePlayService;

    if (featureToggleConfigs[FEATURE_TOGGLE_USE_FIREBASE].setting) {
      const firebaseApp = firebase.initializeApp(firebaseConfig);
      connectService = new ConnectServiceFirebase(firebaseApp);
      loginService = new LoginServiceFirebase(firebaseApp);
      usersService = new UsersServiceFirebase(firebaseApp);
      startGameService = new GamePlayStartFirebase(firebaseApp);
      gamePlayServiceMeteor = new GamePlayServiceFirebase(firebaseApp);
      uploaderService = new UploaderServiceFirebase(firebaseApp);

      uploaderCollections['avatar'] = {name: 'avatar', reference: 'avatar'};
      let avatar = new AvatarModel(firebaseApp);
      middleware.push(avatar.watchForAvatarUploadMiddleWare);

      let staticResources = new StaticResources(Meteor.absoluteUrl); // until dev environment moves

    } else {
      connectService = new ConnectServiceMeteor();
      loginService = new LoginServiceMeteor();
      usersService = new UsersServiceMeteor();
      startGameService = new GamePlayStartMeteor();
      gamePlayServiceMeteor = new GamePlayServiceMeteor();
      uploaderService = new UploaderServiceMeteor();

      uploaderCollections['avatar'] = {name: 'avatar', reference: AvatarOriginalStore};

      let staticResources = new StaticResources(Meteor.absoluteUrl);
    }
    const gameStartPackage = new GameStartPackage(startGameService);
    const gamePlayPackage = new GamePlayPackage(gamePlayServiceMeteor);
    const connectModule = new ConnectPackage(connectService);
    const loginModule = new LoginPackage(loginService);
    const featureTogglePackage = new FeatureTogglePackage();
    const uploaderPackage = new UploaderPackage(uploaderService);

    middleware.push(getAnalyticsMiddleware());
    let options : ICombinerOptions = {
      consoleLogging: featureToggleConfigs['redux-console-logging'].setting,
      otherMiddlewares: middleware
    };

    ReduxPackageCombiner.configure([
      connectModule,
      loginModule,
      new ModalModule(),
      this.accountsAdminModule,
      featureTogglePackage,
      gameStartPackage,
      gamePlayPackage,
      uploaderPackage,
      new UsersPackage(usersService)],
      this.ngRedux,
      options
    );
    FeatureToggleActions.initialize(featureToggleConfigs);
  }
開發者ID:kokokenada,項目名稱:for-real-cards,代碼行數:64,代碼來源:redux-modules.ts


注:本文中的redux-package.ReduxPackageCombiner.configure方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。