Giter VIP home page Giter VIP logo

Comments (4)

scottwrobinson avatar scottwrobinson commented on July 18, 2024

Can you be a bit more specific? If I understand async/await correctly, it works seamlessly with promises, right? And since most, if not all, of the Document methods return relevant data/objects, I'd think something like this should work with async/await:

var smiths = await Person.loadMany({lastName: 'Smith'});
smiths.forEach(function(s) {
    console.log(s.firstName, s.lastName);
});

Admittedly I haven't done any testing with async/await on Camo yet. Since a big part of Camo is emphasizing the new JavaScript syntax/features, I'll have to start testing it more.

Thanks for bringing this up!

from camo.

dcsan avatar dcsan commented on July 18, 2024

I guess you're right, it would be just using the existing camo API in an ES7 environment.

might be nice to see a little demo node app with the required Babel transpilers etc all bundled up, and maybe a nice pipeline with webpack.

I guess node still doesn't support it natively yet. according to this maybe not for awhile:
http://kangax.github.io/compat-table/es7/#babel

and I guess there are gotchas around inner/outer functions and where you actually 'await'
http://pouchdb.com/2015/03/05/taming-the-async-beast-with-es7.html

I did see some demos with Fibers and mongo drivers, and having used Meteor a lot, their mongo API is really easy to work with even on node 10.x series (they wrap everything in fibers)

from camo.

dcsan avatar dcsan commented on July 18, 2024

looks interesting
https://www.npmjs.com/package/nodent

from camo.

scottwrobinson avatar scottwrobinson commented on July 18, 2024

Thanks for the info. I'm working on creating some more formal documentation for Camo, so maybe I'll add a section of examples, including ones using async/await.

If you have any other suggestions or questions, please let me know. Otherwise I'm going to close this issue.

Thanks!

from camo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.