本文整理汇总了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'});
});
示例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);
}