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

Need an additional done? #26

Closed
payne-chris-r opened this issue Jul 6, 2016 · 2 comments
Closed

Need an additional done? #26

payne-chris-r opened this issue Jul 6, 2016 · 2 comments

Comments

@payne-chris-r
Copy link
Contributor

Do we need a done( ) in the catch section as well? Does it auto exit?

const create = function(givenName, surname, dob, gender, height, weight) {
  Person.create({
    'name.given': givenName,
    'name.surname': surname,
    dob: dob,
    gender: gender,
    height: height,
    weight: weight
  }).then((person) => {
    console.log(person.toJSON());
    done();   // We need to call this to terminate the connection.
  }).catch((err) => {
    console.error(err);
  });
};
@payne-chris-r
Copy link
Contributor Author

Suggestion re: @jrhorn424

const create = function(givenName, surname, dob, gender, height, weight) {
  Person.create({
    'name.given': givenName,
    'name.surname': surname,
    dob: dob,
    gender: gender,
    height: height,
    weight: weight
  }).then((person) => {
    console.log(person.toJSON());
  }).catch((err) => {
    console.error(err);
  }).then(done);
};

@payne-chris-r
Copy link
Contributor Author

Damn, I need to finish reading repos...

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

1 participant