當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。