You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I'm still a JS newbie, and very much a n00b to generators, co, monk and co-monk. Probably, I'm making a silly error, but my Google-fu is failing me, so I'm hoping for a pointer in the right direction..
"use strict"; /* jshint node: true, esnext: true */
var monk = require('monk'),
wrap = require('co-monk'),
co = require('co'),
db = monk('localhost:27017/test');
var users = wrap(db.get('users'));
co(function *(){
yield users.remove({});
// the rest of the code from above
// ...
// finally end generator function
// and execute co
})();
What am I doing wrong?
Running node v4.0.0, and get the same error with or without --harmony option.
The text was updated successfully, but these errors were encountered:
Hi, I'm still a JS newbie, and very much a n00b to generators,
co
,monk
andco-monk
. Probably, I'm making a silly error, but my Google-fu is failing me, so I'm hoping for a pointer in the right direction..I get a "TypeError: object is not a function" when trying the example in https://github.com/tj/co-monk/tree/67a867016c945ea9cb6cafdc8b5c97788b797ac5 (using
co
so thatyield
won't get an error):Here's my code:
What am I doing wrong?
Running
node v4.0.0
, and get the same error with or without--harmony
option.The text was updated successfully, but these errors were encountered: