Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot freeze Array Buffer views with elements?? #13

Closed
Kaffiend opened this issue Apr 17, 2017 · 1 comment
Closed

Cannot freeze Array Buffer views with elements?? #13

Kaffiend opened this issue Apr 17, 2017 · 1 comment

Comments

@Kaffiend
Copy link

Throwing a TypeError Cannot freeze array buffer views with elements.
The effect seems pretty straight forward, so im not sure why im getting this. I am however using Electron and Mongo at the service level. Which is returning an observable of the payload as the http service would.

Effect

 @Effect() login$ = this.actions$
        .ofType(userActions.UserActionTypes.USER_LOGIN)
        .switchMap(action => this.userService.getUserLogin(action.payload))
        .map(payload => {
            let userDb = payload;
            return userDb === null ?
                new userActions.UserLoginFailureAction() : new userActions.UserLoginSuccessAction(userDb);
        })
        .catch((err) => {
            console.log(err);
            return Observable.of(new userActions.UserLoginFailureAction());
        });

Service

 getUserLogin(inputUser: User): Observable<User> {
    return this.mongoService.db.flatMap((db: Db) => {
      return Observable.create((observer: Observer<User>) => {
        db.collection('user_docs').findOne({
          $and: [
            { userName: inputUser.userName },
            { password: inputUser.password }
          ]
        }, ((err: MongoError, doc: User) => {
          err ? observer.error(err) : observer.next(doc);
          console.log(doc);
          observer.complete();
        }));
      });
    });
  }
@brandonroberts
Copy link
Owner

If this is still relevant please open a new issue. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants