当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript Store.let方法代码示例

本文整理汇总了TypeScript中@ngrx/store.Store.let方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Store.let方法的具体用法?TypeScript Store.let怎么用?TypeScript Store.let使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在@ngrx/store.Store的用法示例。


在下文中一共展示了Store.let方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: constructor

	constructor(private store: Store<AppState>, private router: Router, private cd: ChangeDetectorRef,
		private siteDataService: SiteDataService){
		
		store.let(appSelectors.getRoutes).subscribe(routes => {
			console.log(routes);
			router.resetConfig(routes);
		});

		store.let(appSelectors.getSiteDataState).subscribe(siteData => {
			this.isAdmin = siteData.isAdmin;
		});

		store.let(appSelectors.getSiteDataState).subscribe(siteData => {
			this.adminModeActive = siteData.adminModeActive;
			if(this.adminModeActive){
				this.adminButtonMessage = 'Admin Mode: On';
				this.adminButtonBackground = 'green';
			}
			else{
				this.adminButtonMessage = 'Admin Mode: Off';
				this.adminButtonBackground = '';

			}
		});
		
	}
开发者ID:bkirby989,项目名称:WallaceTheme,代码行数:26,代码来源:app.component.ts

示例2: constructor

 constructor(private store: Store<any>) {
     this.sentences_nums = store.let(fromRoot.getSelectedExerciseSentencesNums);
     this.sentences = store.let(fromRoot.getSelectedExerciseSentences);
     this.missing_words = store.let(fromRoot.getSelectedExerciseMissingWords);
     this.answers = store.let(fromRoot.getSelectedExerciseMissingWordsAnswers);
     this.validated = store.let(fromRoot.isSelectedExerciseValidated);
 }
开发者ID:pocmanu,项目名称:angular2-seed-advanced,代码行数:7,代码来源:missing-word-container.component.ts

示例3: constructor

	constructor(
		private store: Store<AppState>,
		private nav: NavController
	){
		this.todos = store.let(getTodos());
		this.undoEnabled = store.let(getUndoEnabled());
	}
开发者ID:pawelgur,项目名称:angular-2-ionic-sandbox,代码行数:7,代码来源:list.page.ts

示例4: constructor

  constructor(
    private store: Store<AppState>,
    private nav: NavController,
    private bookActions: BookActions) {
    /**
     * Selectors can be applied with the `let` operator, which passes the source
     * observable to the provided function. This allows us an expressive,
     * composable technique for creating view projections.
     *
     * More on `let`: https://gist.github.com/btroncone/d6cf141d6f2c00dc6b35#let
     * More on selectors: https://gist.github.com/btroncone/a6e4347326749f938510#extracting-selectors-for-reuse
     */
    this.searchQuery$ = store.let(getSearchQuery()).take(1);
    // this.searchQuery$ = this.store.select(s => s.search).select(s => s.query);

    // this.searchQuery$ = store.select('search');

    /*     
        this.searchQuery$ = Observable.create((subscriber) => {
          subscriber.next('hello');
          subscriber.next('world');
          subscriber.complete();      
        });
    */

    this.books$ = store.let(getSearchResults());
  }
开发者ID:tja4472,项目名称:ngrx-clicker-ionic,代码行数:27,代码来源:book-find.ts

示例5: constructor

 constructor(
   private store: Store<fromRoot.State>,
   private app: AppClientService
 ) {
   this.topics$ = store.let(fromRoot.getTopicCollection).distinctUntilChanged();
   this.categories$ = app.categories$;
   this.pageCount$ = store.let(fromRoot.getPageCount).takeLast(1);
 }
开发者ID:csongysun,项目名称:HJPT.f,代码行数:8,代码来源:torrent.component.ts

示例6: constructor

  constructor(
    private nav: NavController,
    private store: Store<AppState>,
    private authService: AuthService
  ) {
    this.participant$ = this.store.let(getParticipant());
    this.experiment$ = this.store.let(getExperiment());

    this.participant$.subscribe(p => this.participant = p);
    this.experiment$.subscribe(e => this.experiment = e);
  }
开发者ID:mciastek,项目名称:emotions-wheel-app,代码行数:11,代码来源:index.ts

示例7: constructor

 constructor(private store: Store<AppState>, private bookActions: BookActions) {
   /**
    * Selectors can be applied with the `let` operator, which passes the source
    * observable to the provided function. This allows us an expressive,
    * composable technique for creating view projections.
    *
    * More on `let`: https://gist.github.com/btroncone/d6cf141d6f2c00dc6b35#let
    * More on selectors: https://gist.github.com/btroncone/a6e4347326749f938510#extracting-selectors-for-reuse
    */
   this.searchQuery$ = store.let(getSearchQuery()).take(1);
   this.books$ = store.let(getSearchResults());
 }
开发者ID:Ammatech,项目名称:example-app,代码行数:12,代码来源:book-find.ts

示例8: ngOnInit

 ngOnInit() {
   this.paymentProviders$ = this.store.let(getAllPaymentProviders)
     .map(providers => providers.filter(provider => {
       if (provider.enabled) {
         // Provider must have asset types to be shown here
         return !!provider.asset_types.length;
       } else {
         // Hide providers that do not have any asset types (these will never have property 'enabled' set to true)
         return !PAY_WITHOUT_ASSETS_PROVIDERS.includes(provider.id);
       }
     }));
   this.paymentProvidersStatus$ = this.store.let(getAllPaymentProvidersStatus);
   this.store.dispatch(new GetAllPaymentProvidersAction());
 }
开发者ID:our-city-app,项目名称:mobicage-payment,代码行数:14,代码来源:add-asset-page-1.component.ts

示例9: ngOnInit

 ngOnInit() {
   this.store.dispatch(new GetAllAssetsAction());
   this.store.dispatch(new GetPaymentProvidersAction());
   this.assets$ = this.store.let(getAssets)
     .combineLatest(this.store.let(getPaymentProviders))
     .map(([ assets, providers ]) => {
       return providers.map(provider => ({
           provider: provider,
           assets: assets.filter(asset => asset.provider_id === provider.id)
         })
       );
     });
   this.assetsStatus$ = this.store.let(getAssetsStatus);
 }
开发者ID:our-city-app,项目名称:mobicage-payment,代码行数:14,代码来源:home-page.component.ts

示例10:

 get promotions$(): Observable<Array<Promotion>> {
   return this.store.let(fromRoot.content.getPromotions)
     .do(v => {
       if (!v)
         this.store.dispatch(new apiAction.GetPromotionsAction());
     }).share();
 }
开发者ID:csongysun,项目名称:HJPT.f,代码行数:7,代码来源:app-client.service.ts


注:本文中的@ngrx/store.Store.let方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。