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


TypeScript effects.ofType函數代碼示例

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


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

示例1: ngOnInit

 ngOnInit() {
   this.paymentProvider = {
     id: '',
     name: '',
     logo: null,
     description: '',
     black_white_logo: null,
     background_color: '#00a263',
     text_color: '#f4f4f4',
     button_color: 'dark',
     version: 1,
     oauth_settings: {
       client_id: '',
       secret: '',
       base_url: '',
       token_path: '',
       authorize_path: '',
       scope: '',
     },
     currencies: [],
     asset_types: [],
     settings: {},
     app_ids: [],
     embedded_application: null,
   };
   this.store.dispatch(new GetBackendRogerthatAppsAction());
   this.status$ = this.store.pipe(select(getBackendPaymentProviderEditStatus));
   this.rogerthatApps$ = this.store.pipe(select(getBackendRogerthatApps));
   this.sub = this.actions$.pipe(ofType(BackendsActionTypes.CREATE_PAYMENT_PROVIDER_COMPLETE)).subscribe(() => {
     this.router.navigate([ '..' ], { relativeTo: this.route });
   });
   this.store.dispatch(new ListEmbeddedAppsAction(EmbeddedAppTag.PAYMENTS));
   this.embeddedApplications$ = this.store.pipe(select(getEmbeddedApps));
 }
開發者ID:our-city-app,項目名稱:plugin-mobicage-control-center,代碼行數:34,代碼來源:create-payment-provider.component.ts

示例2: persistTodos

 @Effect({ dispatch: false })
 persistTodos() {
   return this.actions$.pipe(
     ofType<ActionTodosPersist>(TodosActionTypes.PERSIST),
     tap(action =>
       this.localStorageService.setItem(TODOS_KEY, action.payload.todos)
     )
   );
 }
開發者ID:NLPDev,項目名稱:toHeroku,代碼行數:9,代碼來源:todos.effects.ts

示例3: login

 @Effect({ dispatch: false })
 login() {
   return this.actions$.pipe(
     ofType<ActionAuthLogin>(AuthActionTypes.LOGIN),
     tap(() =>
       this.localStorageService.setItem(AUTH_KEY, { isAuthenticated: true })
     )
   );
 }
開發者ID:NLPDev,項目名稱:toHeroku,代碼行數:9,代碼來源:auth.effects.ts

示例4: ngOnInit

 ngOnInit() {
   this.embeddedApp$ = this.store.pipe(select(getEmbeddedApp), filterNull());
   this.store.dispatch(new GetEmbeddedAppAction(this.route.snapshot.params.embeddedAppId));
   this.getStatus$ = this.store.pipe(select(getEmbeddedAppStatus));
   this.updateStatus$ = this.store.pipe(select(updateEmbeddedAppStatus));
   this._updateSubscription = this.actions$.pipe(
     ofType(BackendsActionTypes.UPDATE_EMBEDDED_APP_COMPLETE),
   ).subscribe(() => this.router.navigate([ '..' ], { relativeTo: this.route }));
 }
開發者ID:our-city-app,項目名稱:plugin-mobicage-control-center,代碼行數:9,代碼來源:update-embedded-app-page.component.ts

示例5: logout

 @Effect({ dispatch: false })
 logout() {
   return this.actions$.pipe(
     ofType<ActionAuthLogout>(AuthActionTypes.LOGOUT),
     tap(() => {
       this.router.navigate(['']);
       this.localStorageService.setItem(AUTH_KEY, { isAuthenticated: false });
     })
   );
 }
開發者ID:NLPDev,項目名稱:toHeroku,代碼行數:10,代碼來源:auth.effects.ts

示例6: constructor

  constructor(actions$: Actions, toast: ToastService) {
    actions$
      .pipe(ofEntityOp(), filter((ea: EntityAction) => ea.payload.entityOp.endsWith(OP_SUCCESS) || ea.payload.entityOp.endsWith(OP_ERROR)))
      // this service never dies so no need to unsubscribe
      .subscribe(action => toast.openSnackBar(`${action.payload.entityName} action`, action.payload.entityOp));

    actions$
      .pipe(ofType(EntityCacheAction.SAVE_ENTITIES_SUCCESS, EntityCacheAction.SAVE_ENTITIES_ERROR))
      .subscribe((action: any) => toast.openSnackBar(`${action.type} - url: ${action.payload.url}`, 'SaveEntities'));
  }
開發者ID:RajeevSingh273,項目名稱:angular-ngrx-data,代碼行數:10,代碼來源:ngrx-data-toast.service.ts

示例7: ngOnInit

 ngOnInit() {
   this.store.dispatch(new GetBackendRogerthatAppsAction());
   this.store.dispatch(new GetPaymentProviderAction(this.route.snapshot.params.paymentProviderId));
   this.paymentProvider$ = this.store.pipe(select(getBackendPaymentProvider), filterNull());
   this.rogerthatApps$ = this.store.pipe(select(getBackendRogerthatApps));
   this.status$ = this.store.pipe(select(getBackendPaymentProviderEditStatus));
   this.sub = this.actions$.pipe(ofType(BackendsActionTypes.UPDATE_PAYMENT_PROVIDER_COMPLETE)).subscribe(() => {
     this.router.navigate([ '..' ], { relativeTo: this.route });
   });
   this.store.dispatch(new ListEmbeddedAppsAction(EmbeddedAppTag.PAYMENTS));
   this.embeddedApplications$ = this.store.pipe(select(getEmbeddedApps));
 }
開發者ID:our-city-app,項目名稱:plugin-mobicage-control-center,代碼行數:12,代碼來源:edit-payment-provider.component.ts

示例8: persistSettings

 @Effect({ dispatch: false })
 persistSettings() {
   return this.actions$.pipe(
     ofType<ActionSettingsPersist>(SettingsActionTypes.PERSIST),
     tap(action => {
       const { settings } = action.payload;
       const { pageAnimations, elementsAnimations } = settings;
       this.localStorageService.setItem(SETTINGS_KEY, settings);
       this.animationsService.updateRouteAnimationType(
         pageAnimations,
         elementsAnimations
       );
     })
   );
 }
開發者ID:NLPDev,項目名稱:toHeroku,代碼行數:15,代碼來源:settings.effects.ts

示例9: pipe

export const filterTypeWithSpace = (x: string, y) => pipe(
  ofType(x),
  withLatestFrom(y)
);
開發者ID:joshuawilson,項目名稱:almighty-ui,代碼行數:4,代碼來源:work-item-utils.ts


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