当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript common-app.LoginActions类代码示例

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


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

示例1: handleError

 private handleError(error) {
   let emitError: IActionError = {
     error: error.code,
     message: error.message
   };
   LoginActions.errorNotification(emitError);
 }
开发者ID:kokokenada,项目名称:for-real-cards,代码行数:7,代码来源:login-service-firebase.ts

示例2: transformUser

        .on('value', (snapshot) => {
          const savedProfile:IUser = snapshot.val();

          const newUserInfo = transformUser(fbuser, savedProfile);
          console.log(newUserInfo);
          subject.next(LoginActions.currentUserChangeFactory(newUserInfo))
        });
开发者ID:kokokenada,项目名称:for-real-cards,代码行数:7,代码来源:login-service-firebase.ts

示例3: reject

 Meteor.logout((error) => {
   if (error) {
     console.error('Error logging out')
     console.error(error)
     reject(ReduxModuleUtil.errorFactory(LoginActions.LOGIN_ERROR, error));
   } else {
     resolve(LoginActions.loggedOutFactory());
   }
 });
开发者ID:kokokenada,项目名称:for-real-cards,代码行数:9,代码来源:login-service-meteor.ts

示例4: isAuto

 let subscription = timer.subscribe(() => {
   let meteorUser = Meteor.user();
   if (meteorUser) {
     subject.next( LoginActions.loginSuccessFactory(
       this.userFromMeteorUser(meteorUser),
       meteorUser._id,
       isAuto(lastLoginState)
     ));
     subject.complete();
     subscription.unsubscribe();
   }
 });
开发者ID:kokokenada,项目名称:for-real-cards,代码行数:12,代码来源:login-service-meteor.ts

示例5: function

 function (error, numberAffected: number) {
   if (error) {
     console.error(error);
     reject(ReduxModuleUtil.errorFactory(LoginActions.LOGIN_ERROR, error));
   } else {
     if (numberAffected === 1) {
       resolve(LoginActions.saveUserResponseFactory(edittedUserObject));
     } else {
       let errorDescription: string = 'Unexpected number of records affected. (' + numberAffected + ')';
       console.error(errorDescription);
       reject(ReduxModuleUtil.errorFactory(LoginActions.LOGIN_ERROR, error));
     }
   }
 }
开发者ID:kokokenada,项目名称:for-real-cards,代码行数:14,代码来源:login-service-meteor.ts

示例6: watchForAutoLogin

  watchForAutoLogin(): Observable<ILoginActionPayload> {
    const isAuto = ( loginState: ILoginState ): boolean => {
      if (loginState)
        return loginState.userId === null;
      return false;
    };

    let meteorUser = Meteor.user();
    let lastLoginState = null;
    ReduxPackageCombiner
      .select(LOGIN_PACKAGE_NAME)
      .subscribe((loginState: ILoginState) => {
        lastLoginState = loginState;
      });
    if (meteorUser) {
      return Observable.of(LoginActions.loginSuccessFactory(
        this.userFromMeteorUser(meteorUser),
        meteorUser._id,
        isAuto(lastLoginState)
      ));
    }

    let subject = new Subject();
    let timer = Observable.timer(500, 1000);
    let subscription = timer.subscribe(() => {
      let meteorUser = Meteor.user();
      if (meteorUser) {
        subject.next( LoginActions.loginSuccessFactory(
          this.userFromMeteorUser(meteorUser),
          meteorUser._id,
          isAuto(lastLoginState)
        ));
        subject.complete();
        subscription.unsubscribe();
      }
    });
    return subject;
  };
开发者ID:kokokenada,项目名称:for-real-cards,代码行数:38,代码来源:login-service-meteor.ts

示例7:

 Tracker.autorun( () => {
   let user = Meteor.user();
   console.log(user)
   subject.next( LoginActions.currentUserChangeFactory(this.userFromMeteorUser(user)))
 });
开发者ID:kokokenada,项目名称:for-real-cards,代码行数:5,代码来源:login-service-meteor.ts


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