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


TypeScript base.Store類代碼示例

本文整理匯總了TypeScript中base.Store的典型用法代碼示例。如果您正苦於以下問題:TypeScript Store類的具體用法?TypeScript Store怎麽用?TypeScript Store使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


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

示例1: hmrOnDestroy

 hmrOnDestroy(store) {
   const cmpLocation = this.appRef.components.map(cmp => cmp.location.nativeElement);
   this.store.first().subscribe(s => store.rootState = s);
   store.disposeOldHosts = createNewHosts(cmpLocation);
   store.restoreInputValues  = createInputTransfer();
   removeNgStyles();
 }
開發者ID:atSistemas,項目名稱:angular-base,代碼行數:7,代碼來源:index.ts

示例2: onClickOperation

 onClickOperation(value: any) {
   let actionType: any;
   switch (value) {
     case 'C':   actionType = ActionTypes.CLEAN; break;
     case '+/-': actionType = ActionTypes.CHANGE_SIGN; break;
     case '%': actionType = ActionTypes.PERCENT; break;
     default: break;
   }
   this.store.dispatch(this.calculatorActions.inputOperation(actionType));
 }
開發者ID:atSistemas,項目名稱:angular-base,代碼行數:10,代碼來源:buttonPannel.component.ts

示例3: onClickOperator

 onClickOperator(operator: any) {
   let actionType: any;
   switch (operator) {
     case 'รท': actionType = ActionTypes.DIVIDE; break;
     case 'x': actionType = ActionTypes.MULTIPLY; break;
     case '-': actionType = ActionTypes.SUBSTRACT; break;
     case '+': actionType = ActionTypes.SUM; break;
     default: break;
   }
   this.store.dispatch(this.calculatorActions.inputOperator(actionType));
 }
開發者ID:atSistemas,項目名稱:angular-base,代碼行數:11,代碼來源:buttonPannel.component.ts

示例4: hmrOnInit

  hmrOnInit(store) {
    console.log('[BASE] Restoring State...');
    if (!store || !store.rootState) return;
    if (store.rootState) {
      this.store.dispatch(
        { type: 'SET_ROOT_STATE', payload: store.rootState }
      );
    }

    if ('restoreInputValues' in store) { store.restoreInputValues(); }
    this.appRef.tick();
    Object.keys(store).forEach(prop => delete store[prop]);
  }
開發者ID:atSistemas,項目名稱:angular-base,代碼行數:13,代碼來源:index.ts

示例5: onClickResult

 onClickResult() {
   this.store.dispatch(this.calculatorActions.result());
 }
開發者ID:atSistemas,項目名稱:angular-base,代碼行數:3,代碼來源:buttonPannel.component.ts

示例6: onClickDecimal

 onClickDecimal() {
   this.store.dispatch(this.calculatorActions.inputDecimal());
 }
開發者ID:atSistemas,項目名稱:angular-base,代碼行數:3,代碼來源:buttonPannel.component.ts

示例7: onClickNumber

 onClickNumber(value: any) {
   this.store.dispatch(this.calculatorActions.inputNumber(value));
 }
開發者ID:atSistemas,項目名稱:angular-base,代碼行數:3,代碼來源:buttonPannel.component.ts


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