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

TypeScript store.NgRedux类代码示例

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

本文整理汇总了TypeScript中@angular-redux/store.NgRedux的典型用法代码示例。如果您正苦于以下问题:TypeScript NgRedux类的具体用法?TypeScript NgRedux怎么用?TypeScript NgRedux使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



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

示例1: constructor

  constructor(private ngRedux: NgRedux<IAppState>,
              private router: Router,
              private userEpics: UserEpics,
              private profileEpics: ProfileEpics,
              private quotesEpics: QuotesEpics,
              private usersEpics: UsersEpics) {

    const epics = [
      this.userEpics.signin,
      this.userEpics.signup,
      this.userEpics.resetPassword,
      this.userEpics.changePassword,
      this.profileEpics.fetchUser,
      this.profileEpics.updateUser,
      this.quotesEpics.fetchQuotes,
      this.quotesEpics.saveQuote,
      this.quotesEpics.updateQuoteModal,
      this.quotesEpics.updateQuote,
      this.quotesEpics.removeQuote,
      this.quotesEpics.recommendQuote,
      this.quotesEpics.unrecommendQuote,
      this.usersEpics.fetchUsers,
      this.usersEpics.followUser,
      this.usersEpics.unfollowUser,
    ];

    const epicsMiddlewares = epics.reduce((acc: any[], epic: any) => acc.concat(createEpicMiddleware(epic)), []);

    ngRedux.configureStore(rootReducer, {}, [...middlewares, ...epicsMiddlewares], enhancers);
  }
开发者ID:rtbm,项目名称:ng2-quottr,代码行数:30,代码来源:app.component.ts


示例2: beforeEach

        beforeEach(inject([NgRedux], (store: NgRedux<AppState>) => {
            const action = commandGelungen(
                {type: CommandType.BeginneInventur, payload: {id: '4711'}, meta: {}},
                {status: 200, message: 'OK'})

            store.dispatch(action)
        }))
开发者ID:haschi,项目名称:dominium,代码行数:7,代码来源:inventur.service.spec.ts


示例3: constructor

  constructor(
    private ngRedux: NgRedux<IAppState>,
    private devTool: DevToolsExtension,
    private rootEpic: RootEpic,
    private router: Router,
  ) {
    const middleware = [
      createEpicMiddleware(this.rootEpic.combineAll()),
      createLogger(),
    ];

    const reducer = compose(
      mergePersistedState()
    )(rootReducer);

    const storage = compose(
      filter('auth')
    )(adapter(window.localStorage));

    const enhancers = [
      persistState(storage, 'fyibn/store'),
    ];

    if (devTool.isEnabled()) {
      enhancers.push(devTool.enhancer());
    }

    this.ngRedux.configureStore(
      reducer,
      {} as IAppState,
      middleware,
      enhancers,
    );
  }
开发者ID:pusherman,项目名称:fyibn-ui,代码行数:34,代码来源:app.component.ts


示例4: constructor

 constructor(ngRedux: NgRedux<IAppState>) {
   // Tell @angular-redux/store about our rootReducer and our initial state.
   // It will use this to create a redux store for us and wire up all the
   // events.
   ngRedux.configureStore(
     rootReducer,
     INITIAL_STATE);
 }
开发者ID:,项目名称:,代码行数:8,代码来源:


示例5: logout

 logout() {
   this.ngRedux.dispatch({type: 'RESET_BOARD_STORE'});
   this.ngRedux.dispatch({type: 'RESET_USER_STORE'});
   this.ngRedux.dispatch({type: 'RESET_CARD_STORE'});
   this.ngRedux.dispatch({type: 'RESET_LIST_STORE'});
   this.ngRedux.dispatch({type: 'REMOVE_BOARD_PREFERENCES'});
   localStorage.removeItem('token');
   this.router.navigate(['/start']);
 }
开发者ID:w11k,项目名称:calendar-for-trello,代码行数:9,代码来源:trello-auth.service.ts


示例6:

          this.userRef.valueChanges().subscribe((u: IUser) => {
            if(u) {
              this.user = u;
              this.user.userId = this.userId;

              let cats = !this.user.categories ? [] : this.user.categories;

              this.ngRedux.dispatch({type: Actions.LOAD_USER, user: this.user});
              this.ngRedux.dispatch({type: Actions.LOAD_CATEGORIES, categories: cats});
            }
          });          
开发者ID:Leks12lk,项目名称:ng5-lib-note,代码行数:11,代码来源:user.service.ts


示例7: getCourses

  getCourses() {
    let coursesFetchedData: ICourse[] = [
      {
        id: 1,
        name: 'Learning Flux',
        topic: 'Flux',
      },
      {
        id: 2,
        name: 'Learning Angular2',
        topic: 'Angular2',
      },
      {
        id: 3,
        name: 'Using Redux with Angular2',
        topic: 'Angular2',
      }
    ];

    // store.dispatch({
    //   type: 'GET_COURSES_SUCCESS',
    //   coursesFetchedData
    // });

    /* note: in advanced version, this will be its own layer/injectable service - removed from Ng Data/http services */
    this.ngRedux.dispatch({
      type: 'GET_COURSES_SUCCESS',
      coursesFetchedData,
    });

  };
开发者ID:SteveJPalmer,项目名称:myCode,代码行数:31,代码来源:courses.service.ts


示例8: ngOnInit

  ngOnInit() {
    let options = this.storeId? this.ngRedux.getState()[this.storeId].options : this.ngRedux.getState().options;

    if(options && options[this.option]){
      this.active = true
    }
  }
开发者ID:Arne-Sandberg,项目名称:HawsIoT-WebApp,代码行数:7,代码来源:option-toggle.component.ts


示例9: beginneInventur

    beginneInventur(id: any) {
        this.command.send(
            CommandType.BeginneInventur,
            {id: id},
            {});

        const state = this.store.getState();
    }
开发者ID:haschi,项目名称:dominium,代码行数:8,代码来源:inventur.service.ts


示例10:

    this.geolocationCoordinates$.subscribe((location: GeoJSON.Position) => {
      this.currentLocation = location;

      // If it is the first view, then set the current center
      if (this.ngRedux.getState().firstView && location) {
        this.center = location;
      }
    });
开发者ID:christinakayastha,项目名称:parkabler,代码行数:8,代码来源:map.component.ts



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
TypeScript testing.MockNgRedux类代码示例发布时间:2022-05-28
下一篇:
TypeScript store.DevToolsExtension类代码示例发布时间: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