• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

TypeScript effects.ofType函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
TypeScript effects.runEffects函数代码示例发布时间:2022-05-28
下一篇:
TypeScript effects.getEffectsMetadata函数代码示例发布时间:2022-05-28
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap